From b9c6f2f3a368274a21cee17d4e3ffe2f9980ec7d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 19 Mar 2013 20:49:46 +0000 Subject: - minor optimizations; - code cleaning; git-svn-id: http://svn.miranda-ng.org/main/trunk@4116 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/hotkeyhandler.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'plugins/TabSRMM/src/hotkeyhandler.cpp') diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 936d1991b7..486525afe6 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -122,7 +122,7 @@ void TSAPI HandleMenuEntryFromhContact(int iSelection) ActivateExistingTab(pContainer, si->hWnd); if (GetForegroundWindow() != pContainer->hwnd) SetForegroundWindow(pContainer->hwnd); - SetFocus(GetDlgItem(pContainer->hwndActive, IDC_CHAT_MESSAGE)); + SetFocus( GetDlgItem(pContainer->hwndActive, IDC_CHAT_MESSAGE)); } else goto nothing_open; } else @@ -146,6 +146,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP { static POINT ptLast; static int iMousedown; + int iSelection; if (msg == WM_TASKBARCREATED) { CreateSystrayIcon(FALSE); @@ -155,7 +156,6 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP } TContainerData *pContainer = pFirstContainer; - int iSelection; switch (msg) { case WM_CREATE: @@ -282,11 +282,11 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (IsIconic(pLastActiveContainer->hwnd) || !IsWindowVisible(pLastActiveContainer->hwnd)) { SendMessage(pLastActiveContainer->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); SetForegroundWindow(pLastActiveContainer->hwnd); - SetFocus(GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE)); + SetFocus( GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE)); } else if (GetForegroundWindow() != pLastActiveContainer->hwnd) { SetForegroundWindow(pLastActiveContainer->hwnd); - SetFocus(GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE)); + SetFocus( GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE)); } else { if (PluginConfig.m_HideOnClose) @@ -316,9 +316,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP CheckMenuItem(submenu, ID_TRAYCONTEXT_SHOWTHETRAYICON, MF_BYCOMMAND | (nen_options.bTraySupport ? MF_CHECKED : MF_UNCHECKED)); iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL); if (iSelection) { - MENUITEMINFO mii = {0}; - - mii.cbSize = sizeof(mii); + MENUITEMINFO mii = { sizeof(mii) }; mii.fMask = MIIM_DATA | MIIM_ID; GetMenuItemInfo(submenu, (UINT_PTR)iSelection, FALSE, &mii); if (mii.dwItemData != 0) // this must be an itm of the fav or recent menu @@ -403,7 +401,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP pContainer = 0; SendMessage(hWnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer); if (pContainer) { - int iTabs = TabCtrl_GetItemCount(GetDlgItem(pContainer->hwnd, IDC_MSGTABS)); + int iTabs = TabCtrl_GetItemCount( GetDlgItem(pContainer->hwnd, IDC_MSGTABS)); if (iTabs == 1) SendMessage(pContainer->hwnd, WM_CLOSE, 0, 1); else @@ -422,7 +420,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP pContainer = 0; SendMessage(si->hWnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer); if (pContainer) { - int iTabs = TabCtrl_GetItemCount(GetDlgItem(pContainer->hwnd, 1159)); + int iTabs = TabCtrl_GetItemCount( GetDlgItem(pContainer->hwnd, 1159)); if (iTabs == 1) SendMessage(pContainer->hwnd, WM_CLOSE, 0, 1); else @@ -497,7 +495,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP M->m_pfnDwmExtendFrameIntoClientArea(pContainer->hwnd, &m); } if (pContainer->SideBar->isActive()) - RedrawWindow(GetDlgItem(pContainer->hwnd, 5000), NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); // the container for the sidebar buttons + RedrawWindow( GetDlgItem(pContainer->hwnd, 5000), NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); // the container for the sidebar buttons RedrawWindow(pContainer->hwnd, NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN); pContainer = pContainer->pNextContainer; } @@ -530,7 +528,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP FreeTabConfig(); ReloadTabConfig(); while (pContainer) { - SendMessage(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), EM_THEMECHANGED, 0, 0); + SendMessage( GetDlgItem(pContainer->hwnd, IDC_MSGTABS), EM_THEMECHANGED, 0, 0); BroadCastContainer(pContainer, EM_THEMECHANGED, 0, 0); pContainer = pContainer->pNextContainer; } -- cgit v1.2.3