X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=event.cpp;fp=event.cpp;h=a409b11761ff65c9685cfc2651c4926e5bc9b965;hb=8754d6de6c36a1859ad0adfef1e456b4a2ebd3a6;hp=4af50a86a925399aa93c8d4835742406c6f7ad84;hpb=2e2d1245db50b3244ba8f2b539f0e7d298c0b8b7;p=nssm.git diff --git a/event.cpp b/event.cpp index 4af50a8..a409b11 100644 --- a/event.cpp +++ b/event.cpp @@ -72,7 +72,7 @@ void print_message(FILE *file, unsigned long id, ...) { } /* Show a GUI dialogue */ -int popup_message(unsigned int type, unsigned long id, ...) { +int popup_message(HWND owner, unsigned int type, unsigned long id, ...) { va_list arg; TCHAR *format = message_string(id); @@ -89,7 +89,20 @@ int popup_message(unsigned int type, unsigned long id, ...) { } va_end(arg); - int ret = MessageBox(0, blurb, NSSM, type); + MSGBOXPARAMS params; + ZeroMemory(¶ms, sizeof(params)); + params.cbSize = sizeof(params); + params.hInstance = GetModuleHandle(0); + params.hwndOwner = owner; + params.lpszText = blurb; + params.lpszCaption = NSSM; + params.dwStyle = type; + if (type == MB_OK) { + params.dwStyle |= MB_USERICON; + params.lpszIcon = MAKEINTRESOURCE(IDI_NSSM); + } + + int ret = MessageBoxIndirect(¶ms); LocalFree(format);