EnumWindows The EnumWindows function enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE. BOOL EnumWindows( WNDENUMPROC lpEnumFunc, // pointer to callback function LPARAM lParam // application-defined value );
Parameters lpEnumFunc Pointer to an application-defined callback function. For more information, see EnumWindowsProc. lParam Specifies an application-defined value to be passed to the callback function. Return Values If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, callGetLastError.Res The EnumWindows function does not enumerate child windows. This function is more reliable than calling the GetWindow function in a loop. An application that calls GetWindow to perform this task risks being caught in an infinite loop or referencing a handle to a window that has been destroyed. EnumWindowsProc The EnumWindowsProc function is an application-defined callback function used with the EnumWindows orEnumDesktopWindows function. It receives top-level window handles. The WNDENUMPROC type defines a pointer to this callback function. EnumWindowsProc is a placeholder for the application-defined function name. BOOL CALLBACK EnumWindowsProc( HWND hwnd, // handle to parent window LPARAM lParam // application-defined value );
Parameters hwnd Handle to a top-level window. lParam Specifies the application-defined value given in EnumWindows or EnumDesktopWindows. Return Values To continue enumeration, the callback function must return TRUE; to stop enumeration, it must return FALSE. Res An application must register this callback function by passing its address to EnumWindows or EnumDesktopWindows.
bool bRet; //枚举顶层窗口 bRet=EnumWindows((WNDENUMPROC)EnumWindowsProc,lmyParam);为什么会出现这样错误:cannot convert from '' to 'int (__stdcall *)(struct HWND__ *,long)'
谢谢
The EnumWindows function enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE. BOOL EnumWindows(
WNDENUMPROC lpEnumFunc, // pointer to callback function
LPARAM lParam // application-defined value
);
Parameters
lpEnumFunc
Pointer to an application-defined callback function. For more information, see EnumWindowsProc.
lParam
Specifies an application-defined value to be passed to the callback function.
Return Values
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, callGetLastError.Res
The EnumWindows function does not enumerate child windows. This function is more reliable than calling the GetWindow function in a loop. An application that calls GetWindow to perform this task risks being caught in an infinite loop or referencing a handle to a window that has been destroyed. EnumWindowsProc
The EnumWindowsProc function is an application-defined callback function used with the EnumWindows orEnumDesktopWindows function. It receives top-level window handles. The WNDENUMPROC type defines a pointer to this callback function. EnumWindowsProc is a placeholder for the application-defined function name. BOOL CALLBACK EnumWindowsProc(
HWND hwnd, // handle to parent window
LPARAM lParam // application-defined value
);
Parameters
hwnd
Handle to a top-level window.
lParam
Specifies the application-defined value given in EnumWindows or EnumDesktopWindows.
Return Values
To continue enumeration, the callback function must return TRUE; to stop enumeration, it must return FALSE. Res
An application must register this callback function by passing its address to EnumWindows or EnumDesktopWindows.
//枚举顶层窗口
bRet=EnumWindows((WNDENUMPROC)EnumWindowsProc,lmyParam);为什么会出现这样错误:cannot convert from '' to 'int (__stdcall *)(struct HWND__ *,long)'