读书人

高手vc中获取模态对话框句柄有几种方法

发布时间: 2012-02-16 21:30:36 作者: rapoo

求助高手vc中获取模态对话框句柄有几种方法,各是什么?
vc中获取模态对话框句柄有几种方法,每种方法是怎么样实现的?
小弟先谢啦

[解决办法]
HWND FindWindow(
LPCTSTR lpClassName, // class name NULL if you don 't know
LPCTSTR lpWindowName // window name caption of the window
);
[解决办法]
EnumWindows Function

--------------------------------------------

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.

Syntax

BOOL EnumWindows( WNDENUMPROC lpEnumFunc,
LPARAM lParam
);
Parameters

lpEnumFunc
[in] Pointer to an application-defined callback function. For more information, see EnumWindowsProc.
lParam
[in] Specifies an application-defined value to be passed to the callback function.
Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

If EnumWindowsProc returns zero, the return value is also zero. In this case, the callback function should call SetLastError to obtain a meaningful error code to be returned to the caller of EnumWindows.

读书人网 >C++

热点推荐