From b098799c15568ac46d96739682adb2fc24231b08 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 23 Mar 2013 17:41:17 +0000 Subject: Ctrl+Z works again git-svn-id: http://svn.miranda-ng.org/main/trunk@4167 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/chat/window.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'plugins/TabSRMM/src/chat/window.cpp') diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 51b11840fa..0184c0e36f 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -539,25 +539,19 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - MESSAGESUBDATA *dat; - SESSION_INFO* Parentsi; - struct TWindowData *mwdat; HWND hwndParent = GetParent(hwnd); + TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA); + SESSION_INFO *Parentsi = (SESSION_INFO *)mwdat->si; - mwdat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA); - Parentsi = (SESSION_INFO *)mwdat->si; - - dat = (MESSAGESUBDATA *) GetWindowLongPtr(hwnd, GWLP_USERDATA); + MESSAGESUBDATA *dat = (MESSAGESUBDATA *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (mwdat->fkeyProcessed && (msg == WM_KEYUP)) { GetKeyboardState(mwdat->kstate); - if (mwdat->kstate[VK_CONTROL] & 0x80 || mwdat->kstate[VK_SHIFT] & 0x80) - return 0; - else { + if ( !(mwdat->kstate[VK_CONTROL] & 0x80) && !(mwdat->kstate[VK_SHIFT] & 0x80)) mwdat->fkeyProcessed = false; - return 0; - } + return 0; } + switch (msg) { case WM_NCCALCSIZE: return CSkin::NcCalcRichEditFrame(hwnd, mwdat, ID_EXTBKINPUTAREA, msg, wParam, lParam, MessageSubclassProc); @@ -573,7 +567,6 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_CONTEXTMENU: { MODULEINFO* mi = MM_FindModule(Parentsi->pszModule); - HMENU hMenu, hSubMenu; CHARRANGE sel, all = { 0, -1}; int iSelection; int iPrivateBG = M->GetByte(mwdat->hContact, "private_bg", 0); @@ -582,8 +575,8 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, int idFrom = IDC_CHAT_MESSAGE; GetCursorPos(&pt); - hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)); - hSubMenu = GetSubMenu(hMenu, 2); + HMENU hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)); + HMENU hSubMenu = GetSubMenu(hMenu, 2); RemoveMenu(hSubMenu, 9, MF_BYPOSITION); RemoveMenu(hSubMenu, 8, MF_BYPOSITION); RemoveMenu(hSubMenu, 4, MF_BYPOSITION); -- cgit v1.2.3