maysam
maysam

Reputation: 519

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_hInstance = 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);
 }

Upvotes: 1

Views: 177

Answers (1)

Mordachai
Mordachai

Reputation: 9642

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

Upvotes: 2

Related Questions