日期:2014-05-20  浏览次数:20923 次

FindWindow 怎么只能得到部分进程的句柄,高手帮我解答,谢谢。
//主要的代码

[DllImport( "user32.dll ",   EntryPoint   =   "FindWindowA ")]   //找进程句柄
private   static   extern   IntPtr   FindWindow(string   lpClassName,   string   lpWindowName);

IntPtr   hWndParent   =   FindWindow(null,   "WindowsApplication1 ");


我事先打开WindowsApplication1.exe进程,然后运行上面的代码,最后得到的句柄
hWndParent   一直是0

------解决方案--------------------
FindWindow
查找的不是进程,而是窗口,

所以你要传窗口的句子或它的标题才行!不要传程序的名字.