如果是windows下的,可以试一下,exescope,reshack之类的软件。好象可以改的。它对你这个软件是不是有效就不知道了。

解决方案 »

  1.   

    public const int WM_SETTEXT = 0xC;[DllImport("user32.dll", EntryPoint="SendMessageA")]
    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 , "^_^" );
    }
      

  2.   

    [DllImport("user32.dll", EntryPoint="SendMessageA")]
    怎么做?
      

  3.   

    using System.Runtime.InteropServices;
      

  4.   

    static void Main() 
    {
    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";
    }对么?
    编译和运行都没有错
    但是不能出来标题栏
      

  5.   

    IntPtr handler = proc.MainWindowHandle;
    获取当前进程主窗口的Handle,aa.Handle是当前进程的Handle
      

  6.   

    改为: static void Main() 
    {
    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 , "^_^" );
    }还不行:(
      

  7.   

    另一个思路也想过
    不过更不会作了
    MDI?
    没有看到有这个功能
      

  8.   

    我有一段代码,你可以试一下,不一定管用:
    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
    }
      

  9.   

    呵呵,真的奇怪了,我这里是可以的啊。不知道你所启动的程序有几个窗体?启动时有Splash窗体吗?可能是需要改名的窗体句柄不对?你这样测试一下,procs = Process.GetProcesses();
     
    foreach( Process proc in procs )
    {
    IntPtr hwnd = proc.MainWindowHandle;
    SendMessage( hwnd , WM_SETTEXT , 0 , "^_^" );
    }一般带启动窗体的程序不会改过来如VS2003之类的,像IE,Outlook等窗体名都改了。
      

  10.   

    Re: OneDotRed
    您的程序只能修改已经有标题栏的标题
    不能把没有标题栏的程序弄出标题栏
      

  11.   

    用SetParent把那个窗体加到一个正常窗口里,如何!
      

  12.   


    [DllImport("user32.dll", EntryPoint="SetWindowText")]
    public static extern int SetWindowText (
    int hwnd,
    string lpString
    );  hwnd -----------  Long,要设置文字的窗口的句柄  lpString -------  String,要设到hwnd窗口中的文字
      

  13.   

    to  hbxtlhx && tonghuil && hbxtlhx
    都是只能修改已经有标题栏程序的标题
      

  14.   

    to hbxtlhx
    能给SetParent这个方法的全限定名么?
      

  15.   

    to  OneDotRed && tonghuil && hbxtlhx
    都是只能修改已经有标题栏程序的标题
    上个帖子写错了:(
      

  16.   

    写信去IBM  叫他们给你加上标题栏  :)
      

  17.   

    只不过拿ibm的这个程序做一个例子