【函数】
FindWindowEx【操作系统】
Win9X:Yes
WinNT:No【声明】
FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long【说明】  在窗口列表中寻找与指定条件相符的第一个子窗口 【返回值】  Long,找到的窗口的句柄。如未找到相符窗口,则返回零。会设置GetLastError 【其它】
【参数表】
  hWnd1 ----------  Long,在其中查找子的父窗口。如设为零,表示使用桌面窗口(通常说的顶级窗口都被认为是桌面的子窗口,所以也会对它们进行查找)  hWnd2 ----------  Long,从这个窗口后开始查找。这样便可利用对FindWindowEx的多次调用找到符合条件的所有子窗口。如设为零,表示从第一个子窗口开始搜索  lpsz1 ----------  String,欲搜索的类名。零表示忽略  lpsz2 ----------  String,欲搜索的类名。零表示忽略 函数功能:该函数获得一个窗口的句柄,该窗口的类名和窗口名与给定的字符串相匹配。这个函数查找子窗口,从排在给定的子窗口后面的下一个子窗口开始。在查找时不区分大小写。    函数原型:HWND FindWindowEx(HWND hwndParent,HWND hwndChildAfter,LPCTSTR lpszClass,LPCTSTR lpszWindow);    参数;    hwndParent:要查找子窗口的父窗口句柄。    如果hwnjParent为NULL,则函数以桌面窗口为父窗口,查找桌面窗口的所有子窗口。    Windows NT5.0 and later:如果hwndParent是HWND_MESSAGE,函数仅查找所有消息窗口。    hwndChildAfter :子窗口句柄。查找从在Z序中的下一个子窗口开始。子窗口必须为hwndPareRt窗口的直接子窗口而非后代窗口。如果HwndChildAfter为NULL,查找从hwndParent的第一个子窗口开始。如果hwndParent 和 hwndChildAfter同时为NULL,则函数查找所有的顶层窗口及消息窗口。    lpszClass:指向一个指定了类名的空结束字符串,或一个标识类名字符串的成员的指针。如果该参数为一个成员,则它必须为前次调用theGlobaIAddAtom函数产生的全局成员。该成员为16位,必须位于lpClassName的低16位,高位必须为0。    lpszWindow:指向一个指定了窗口名(窗口标题)的空结束字符串。如果该参数为 NULL,则为所有窗口全匹配。返回值:如果函数成功,返回值为具有指定类名和窗口名的窗口句柄。如果函数失败,返回值为NULL。    若想获得更多错误信息,请调用GetLastError函数。    速查 NT:4.0对以上版本;Windows:95以上版本;Windows CE:不支持;头文件:winuser.h;库文件:user32.Lib;Unicode:在Windows NT上实现为Unicode和ANSI两种版本。==========================================================================
问题是请解释一下参数的具体的意思!!!
LPSZ1,LPSZ2,为什么要搜索两次类呢????

解决方案 »

  1.   

    这是msdn上的,一个参数是lpszClass,一个是lpszWindow
    lpszClass
    [in] 
    Pointer to a null-terminated string that specifies the class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be placed in the low-order word of lpszClass; the high-order word must be zero.If lpszClass is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names, or it can be MAKEINTATOM(0x800). In this latter case, 0x8000 is the atom for a menu class. For more information, see the Res section of this topic.lpszWindow
    [in] Pointer to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match.