【发布时间】:2013-04-21 05:45:07
【问题描述】:
我正在学习 C++。我想知道是否有任何 C++ 应用程序有 HWND。示例波纹管应用程序,没有创建窗口。
如果有,我怎样才能得到它的 HWND?非常感谢!
#include <windows.h>
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow )
{
MSG msg;
while( GetMessage( &msg, NULL, 0, 0 ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
【问题讨论】:
-
@ta.speot.is,有一种感觉是
GetConsoleWindow()之前写的。 -
在 Windows 编程之前学习 C++ 是个好主意。或者,如果您想学习使用 WinAPI,如果您不需要 C++ (OOP) 功能,可能 c 就足够了。