开发者

for windows programming in use direct windows api i should use MessageLoop?

开发者 https://www.devze.com 2023-02-03 05:45 出处:网络
in windows programming ishould use MessageLoop? i seeany program have messageLoop but in this code the autor dont use messageloop

in windows programming i should use MessageLoop?

i see any program have messageLoop but in this code the autor dont use messageloop

code snippet :

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR   lpszCmdLine,     int nCmdShow)
{
INITCOMMONCONTROLSEX icc;
WNDCLASSEX wcx;

g_hInstanc开发者_如何学Pythone = hInstance;

icc.dwSize = sizeof(icc);
icc.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&icc);

wcx.cbSize = sizeof(wcx);
if (!GetClassInfoEx(NULL, MAKEINTRESOURCE(32770), &wcx))
    return 0;

wcx.hInstance = hInstance;
wcx.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDR_ICO_MAIN));
wcx.lpszClassName = _T("DirMonClass");
if (!RegisterClassEx(&wcx))
    return 0;

return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)MainDlgProc);
 }


DialogBox supports its own message loop. So if you're writing a simple dialog based app, you don't need an additional message loop.

0

精彩评论

暂无评论...
验证码 换一张
取 消