From a75ce08f5ea46237b73e5052a956829c0e272678 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 17 Jun 2015 17:03:45 +0000 Subject: minus MS_UTILS_SAVEWINDOWPOSITION & MS_UTILS_RESTOREWINDOWPOSITION git-svn-id: http://svn.miranda-ng.org/main/trunk@14238 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Console/src/Console.cpp | 4 +-- plugins/RecentContacts/src/RecentContacts.cpp | 36 ++++++++------------------- plugins/TooltipNotify/src/TooltipNotify.cpp | 6 ++--- 3 files changed, 14 insertions(+), 32 deletions(-) (limited to 'plugins') diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 56e22e7f6d..4ab6c325c4 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -625,10 +625,8 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam hTabs = GetDlgItem(hwndDlg, IDC_TABS); - //TabCtrl_SetMinTabWidth(hTabs, 100); - // restore position - Utils_RestoreWindowPositionEx(hwndDlg, RWPF_HIDDEN, NULL, "Console", "Console"); + Utils_RestoreWindowPosition(hwndDlg, NULL, "Console", "Console", RWPF_HIDDEN); CallService(MS_DB_GETPROFILENAMET, (WPARAM)SIZEOF(name), (LPARAM)name); diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index dc8ac0b113..1e8a7ef15f 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -291,20 +291,12 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM wp.flags = 0; SetWindowPlacement(hDlg, &wp); - } else { - restorePos = true; } + else restorePos = true; } - if (restorePos) { - SAVEWINDOWPOS pos; - pos.hContact = NULL; - pos.hwnd = hDlg; - pos.szModule = dbLastUC_ModuleName; - pos.szNamePrefix = dbLastUC_WindowPosPrefix; - - CallService(MS_UTILS_RESTOREWINDOWPOSITION, 0, (LPARAM)&pos); - } + if (restorePos) + Utils_RestoreWindowPosition(hDlg, NULL, dbLastUC_ModuleName, dbLastUC_WindowPosPrefix); SendMessage(hDlg, WM_SIZE, 0, 0); WindowList_Add(hWindowList, hDlg, NULL); @@ -385,20 +377,14 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM break; case WM_DESTROY: - { - // Save current window position. - SAVEWINDOWPOS pos; - pos.hContact = NULL; - pos.hwnd = hDlg; - pos.szModule = dbLastUC_ModuleName; - pos.szNamePrefix = dbLastUC_WindowPosPrefix; - CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)&pos); - delete DlgDat->Contacts; - delete DlgDat; - // Remove entry from Window list - WindowList_Remove(hWindowList, hDlg); - break; - } + Utils_SaveWindowPosition(hDlg, NULL, dbLastUC_ModuleName, dbLastUC_WindowPosPrefix); + + delete DlgDat->Contacts; + delete DlgDat; + + // Remove entry from Window list + WindowList_Remove(hWindowList, hDlg); + break; } return FALSE; } diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index e1ab66d706..c51b7da658 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -306,10 +306,8 @@ CTooltip *CTooltipNotify::BeginNotify(STooltipData *pTooltipData) SystemParametersInfo(SPI_GETWORKAREA, 0, &WorkAreaRect, 0); pTooltip->get_Rect(&TooltipRect); - if (m_sOptions.bAutoPos || Utils_RestoreWindowPositionEx(pTooltip->GetHandle(), RWPF_NOSIZE | RWPF_NOACTIVATE, 0, MODULENAME, "toolwindow")) - pTooltip->set_Position( - WorkAreaRect.right - 10 - (TooltipRect.right-TooltipRect.left), - WorkAreaRect.bottom - 2 - (TooltipRect.bottom-TooltipRect.top)); + if (m_sOptions.bAutoPos || Utils_RestoreWindowPosition(pTooltip->GetHandle(), 0, MODULENAME, "toolwindow", RWPF_NOSIZE | RWPF_NOACTIVATE)) + pTooltip->set_Position(WorkAreaRect.right - 10 - (TooltipRect.right-TooltipRect.left), WorkAreaRect.bottom - 2 - (TooltipRect.bottom-TooltipRect.top)); UINT_PTR idTimer = SetTimer(0, 0, pTooltipData->uiTimeout, TooltipTimerProcWrapper); pTooltipData->idTimer = idTimer; -- cgit v1.2.3