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

StackOverflow https://stackoverflow.com/questions/4648075

  •  09-10-2019
  •  | 
  •  

سؤال

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);
 }
هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top