The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search. To search child windows, beginning with a specified child window, use the FindWindowEx function. HWND FindWindow( LPCTSTR lpClassName, // class name LPCTSTR lpWindowName // window name );
LPCTSTR lpClassName, // class name
LPCTSTR lpWindowName // window name
);
用法如下
EnumWindows(EnumWindowsProc, (LPARAM)...);BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
//hwnd就是得到得窗口的句柄,可以在这个函数里面判断,保存所需的句柄
}