如果是windows下的,可以试一下,exescope,reshack之类的软件。好象可以改的。它对你这个软件是不是有效就不知道了。
解决方案 »
- 开发智能提示 Intellisense的文本编辑器
- asp.net 如何将excel百万条数据导入到sql里面
- 帮助文档制作
- 【新手请教】winform程序,datagridview,如何让选中值得row显示出来
- 使用vs2005自带的水晶报表时使用打印ActiveX无法安装的问题!
- spread 的Excel输出问题
- 我对sql一个表保存,同时又要对别的一些表进行插入或更新操作
- 新手求助sql05中的某列导出到checklistbox
- 已知注册表项{13321SAF4-704F-7342DFD-7684-7B234FXF8CA}求返回该项的路径
- 如何实现自动识别设备的串口
- 使用HttpWebRequest提交Form参数老是失败,能帮我看看么?
- c#中的几个概念?
public static extern int SendMessage (IntPtr hwnd, int wMsg, int wParam, string lParam);void test()
{
Process proc = Process.Start( "C:\\a.txt" ); IntPtr handler = proc.MainWindowHandle; SendMessage( handler , WM_SETTEXT , 0 , "^_^" );
}
怎么做?
{
Application.Run(new Form1());
} public const int WM_SETTEXT = 0xC; [DllImport("user32.dll", EntryPoint="SendMessageA")]
public static extern int SendMessage (IntPtr hwnd, int wMsg, int wParam, string lParam); private void button1_Click(object sender, System.EventArgs e)
{
if (openFileDialog1.ShowDialog()!=DialogResult.Cancel) textBox1.Text=openFileDialog1.FileName;
Process aa=new Process();
aa.StartInfo.FileName =textBox1.Text;
aa.Start();
IntPtr handler=aa.Handle;
SendMessage( handler , WM_SETTEXT , 0 , "^_^" );
textBox1.Text="";
textBox1.Text="aaa";
}对么?
编译和运行都没有错
但是不能出来标题栏
获取当前进程主窗口的Handle,aa.Handle是当前进程的Handle
{
Application.Run(new Form1());
} public const int WM_SETTEXT = 0xC; [DllImport("user32.dll", EntryPoint="SendMessageA")]
public static extern int SendMessage (IntPtr hwnd, int wMsg, int wParam, string lParam); private void button1_Click(object sender, System.EventArgs e)
{
if (openFileDialog1.ShowDialog()!=DialogResult.Cancel) textBox1.Text=openFileDialog1.FileName;
Process aa=new Process();
aa.StartInfo.FileName =textBox1.Text;
aa.Start();
IntPtr handler=aa.MainWindowHandle;
SendMessage( handler , WM_SETTEXT , 0 , "^_^" );
}还不行:(
不过更不会作了
MDI?
没有看到有这个功能
const int GWL_WNDPROC = -4;
const int GWL_HINSTANCE = -6;
const int GWL_HWNDPARENT = -8;
const int GWL_STYLE = -16;
const int GWL_EXSTYLE = -20;
const int GWL_USERDATA = -21;
const int GWL_ID = -12;const int WS_OVERLAPPED= 0x0000000;
const int WS_POPUP = 0x8000000;
const int WS_CHILD = 0x4000000;
const int WS_MINIMIZE = 0x2000000;
const int WS_VISIBLE = 0x1000000;
const int WS_DISABLED = 0x0800000;
const int WS_CLIPSIBLINGS= 0x0400000;
const int WS_CLIPCHILDREN= 0x0200000;
const int WS_MAXIMIZE = 0x0100000;
const int WS_CAPTION = 0x00C0000; /* WS_BORDER | WS_DLGFRAME */
const int WS_BORDER = 0x0080000;
const int WS_DLGFRAME = 0x0040000;
const int WS_VSCROLL = 0x0020000;
const int WS_HSCROLL = 0x0010000;
const int WS_SYSMENU = 0x0008000;
const int WS_THICKFRAME= 0x0004000;
const int WS_GROUP = 0x0002000;
const int WS_TABSTOP = 0x0001000;const int WM_NCPAINT = 0x0085;[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool UpdateWindow( IntPtr hWnd );[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int SendMessage( IntPtr hWnd,
int Msg,
int wParam,
int lParam
);private void SwitchCaption(IntPtr handle)//your window's handle
{
int style = GetWindowLong(handle, GWL_STYLE);
style = SetWindowLong(handle, GWL_STYLE, style ^ (WS_CAPTION | WS_CLIPSIBLINGS));
SendMessage(handle, WM_NCPAINT, 1, 0);
//close and open the window of the handle
}
foreach( Process proc in procs )
{
IntPtr hwnd = proc.MainWindowHandle;
SendMessage( hwnd , WM_SETTEXT , 0 , "^_^" );
}一般带启动窗体的程序不会改过来如VS2003之类的,像IE,Outlook等窗体名都改了。
您的程序只能修改已经有标题栏的标题
不能把没有标题栏的程序弄出标题栏
[DllImport("user32.dll", EntryPoint="SetWindowText")]
public static extern int SetWindowText (
int hwnd,
string lpString
); hwnd ----------- Long,要设置文字的窗口的句柄 lpString ------- String,要设到hwnd窗口中的文字
都是只能修改已经有标题栏程序的标题
能给SetParent这个方法的全限定名么?
都是只能修改已经有标题栏程序的标题
上个帖子写错了:(