diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdclist/src/clistmenus.cpp | 5 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/miranda.cpp | 14 |
4 files changed, 17 insertions, 4 deletions
diff --git a/src/core/stdclist/src/clistmenus.cpp b/src/core/stdclist/src/clistmenus.cpp index 81f248bf59..753352cc79 100644 --- a/src/core/stdclist/src/clistmenus.cpp +++ b/src/core/stdclist/src/clistmenus.cpp @@ -26,10 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR CloseAction(WPARAM, LPARAM)
{
- while (!Miranda_OkToExit())
- Sleep(100);
-
- DestroyWindow(g_clistApi.hwndContactList);
+ Miranda_Close();
return 0;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 210f167b8f..2820883800 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -1,6 +1,7 @@ LIBRARY mir_app.mir
EXPORTS
+Miranda_Close @1 NONAME
CallProtoService @2
Skin_LoadProtoIcon @4
Skin_LoadIcon @5
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 132aa6225b..6ed7f2a46a 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -1,6 +1,7 @@ LIBRARY mir_app.mir
EXPORTS
+Miranda_Close @1 NONAME
CallProtoService @2
Skin_LoadProtoIcon @4
Skin_LoadIcon @5
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 423f709d75..214a196012 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -427,6 +427,20 @@ MIR_APP_DLL(bool) Miranda_OkToExit() return NotifyEventHooks(hOkToExitEvent, 0, 0) == 0;
}
+MIR_APP_DLL(void) Miranda_Close()
+{
+ while (!Miranda_OkToExit()) {
+ MSG msg;
+ while (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ Sleep(0);
+ }
+
+ DestroyWindow(g_clistApi.hwndContactList);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// version functions
|