[DllImport("user32.dll", EntryPoint = "FindWindow")] public static extern int FindWindow( string lpClassName, string lpWindowName );
[DllImport("user32.dll", EntryPoint = "SendMessage")] public static extern int SendMessage( int hwnd, int wMsg, IntPtr wParam, string lParam ); public const int WM_SETTEXT = 0xC;
int hwnd = FindWindow(null, "无标题 - 记事本"); string s = "要修改的名字"; if (hwnd != 0) { SendMessage(hwnd, WM_SETTEXT, IntPtr.Zero, s); } else { MessageBox.Show("记事本没有运行"); }
Copyright 2001-2010, www.comprg.com.cn, All Rights Reserved 京ICP备14022230号-1,电话/传真:010-82561037 82561614 ,Mail:gaojian@comprg.com.cn
地址:北京市海淀区远大路20号宝蓝大厦E座704,邮编:100089