From a185b0078f635f7bc3a6e5fdf8579164732eb159 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 3 Aug 2019 19:37:15 +0300 Subject: core part of CloseAction went to the core --- src/mir_app/src/mir_app.def | 1 + src/mir_app/src/mir_app64.def | 1 + src/mir_app/src/miranda.cpp | 14 ++++++++++++++ 3 files changed, 16 insertions(+) (limited to 'src/mir_app') 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 -- cgit v1.2.3