summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-28 15:38:49 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-28 15:38:49 +0300
commit2be5844edd93ab3490b4689cad33d75b4c77f3a8 (patch)
tree13721f733442b6068164efd79c3dfdae6aa622d5 /src
parent3ffc894a7a132a013e74fe063b72d79e17c998dc (diff)
and finally MS_MSG_GETWINDOWDATA has gone, zihrono levraha
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/msgs.cpp23
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/srmm_util.cpp22
4 files changed, 24 insertions, 23 deletions
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index d0f70ba10d..03ef642e93 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -495,28 +495,6 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
return 0;
}
-static INT_PTR GetWindowData(WPARAM hContact, LPARAM lParam)
-{
- if (hContact == 0)
- return 1;
-
- MessageWindowData *mwd = (MessageWindowData*)lParam;
- if(mwd == NULL)
- return 1;
-
- HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
- mwd->hwndWindow = hwnd;
- mwd->local = 0;
- mwd->uState = MSG_WINDOW_STATE_EXISTS;
- if (IsWindowVisible(hwnd))
- mwd->uState |= MSG_WINDOW_STATE_VISIBLE;
- if (GetForegroundWindow() == hwnd)
- mwd->uState |= MSG_WINDOW_STATE_FOCUS;
- if (IsIconic(hwnd))
- mwd->uState |= MSG_WINDOW_STATE_ICONIC;
- return 0;
-}
-
static wchar_t tszError[] = LPGENW("Miranda could not load the built-in message module, msftedit.dll is missing. Press 'Yes' to continue loading Miranda.");
int LoadSendRecvMessageModule(void)
@@ -541,7 +519,6 @@ int LoadSendRecvMessageModule(void)
CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand);
CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommand_W);
- CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData);
CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText);
CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 8b65c2bcb6..67645af6f5 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -445,3 +445,4 @@ _stubMessageProc@16 @447 NONAME
_stubNicklistProc@16 @448 NONAME
Chat_GetTextPixelSize @449 NONAME
?NotifyEvent@CSrmmBaseDialog@@IAEHH@Z @450 NONAME
+Srmm_GetWindowData @451
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 856beb7707..563b920ab4 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -445,3 +445,4 @@ stubMessageProc @447 NONAME
stubNicklistProc @448 NONAME
Chat_GetTextPixelSize @449 NONAME
?NotifyEvent@CSrmmBaseDialog@@IEAAHH@Z @450 NONAME
+Srmm_GetWindowData @451
diff --git a/src/mir_app/src/srmm_util.cpp b/src/mir_app/src/srmm_util.cpp
index 78ed59e436..2bd064d1ad 100644
--- a/src/mir_app/src/srmm_util.cpp
+++ b/src/mir_app/src/srmm_util.cpp
@@ -72,3 +72,25 @@ MIR_APP_DLL(DWORD) CALLBACK Srmm_MessageStreamCallback(DWORD_PTR dwCookie, LPBYT
}
return 0;
}
+
+MIR_APP_DLL(int) Srmm_GetWindowData(WPARAM hContact, MessageWindowData &mwd)
+{
+ if (hContact == 0)
+ return 1;
+
+ HWND hwnd = WindowList_Find(chatApi.hWindowList, hContact);
+ if (hwnd == nullptr)
+ return 1;
+
+ mwd.hwndWindow = hwnd;
+ mwd.pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ mwd.uState = MSG_WINDOW_STATE_EXISTS;
+ if (IsWindowVisible(hwnd))
+ mwd.uState |= MSG_WINDOW_STATE_VISIBLE;
+ if (GetForegroundWindow() == hwnd)
+ mwd.uState |= MSG_WINDOW_STATE_FOCUS;
+ if (IsIconic(hwnd))
+ mwd.uState |= MSG_WINDOW_STATE_ICONIC;
+ return 0;
+}
+