开发者

for windows programming in use direct windows api i should 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜