用API函数getwindowthreadprocessid可以做到第2点。<br>下面是MSDN中对这个函数的说明:<br>GetWindowThreadProcessId<br>The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window. <br><br>DWORD GetWindowThreadProcessId(<br> HWND hWnd, // handle to window<br> LPDWORD lpdwProcessId // address of variable for process identifier<br>);<br> <br>Parameters<br>hWnd <br>Handle to the window. <br>lpdwProcessId <br>Pointer to a 32-bit value that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the 32-bit value; otherwise, it does not. <br>Return Values<br>The return value is the identifier of the thread that created the window<br>看得懂这些英文吧,我就不翻译过来了。至于第1个,不知有什么好办法没有。我是用一个循环<br>去找创建这些窗口的进程的ID,找到符合的就列出来!