From 72fd4143b5a49a5842ce0af179b177551d356f91 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Apr 2013 20:44:10 +0000 Subject: another dead plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@4375 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ExternalAPI/delphi/m_magneticWindows.inc | 72 ---- plugins/ExternalAPI/m_MagneticWindows.h | 86 ----- plugins/QuickContacts/src/commons.h | 1 - plugins/QuickContacts/src/quickcontacts.cpp | 397 +++++++++++------------ 4 files changed, 187 insertions(+), 369 deletions(-) delete mode 100644 plugins/ExternalAPI/delphi/m_magneticWindows.inc delete mode 100644 plugins/ExternalAPI/m_MagneticWindows.h (limited to 'plugins') diff --git a/plugins/ExternalAPI/delphi/m_magneticWindows.inc b/plugins/ExternalAPI/delphi/m_magneticWindows.inc deleted file mode 100644 index 885760f629..0000000000 --- a/plugins/ExternalAPI/delphi/m_magneticWindows.inc +++ /dev/null @@ -1,72 +0,0 @@ -{$IFNDEF M_MAGNETICWINDOWS} -{$DEFINE M_MAGNETICWINDOWS} - -const -// For other Plugins to start snapping for their windows -// wparam: hwnd of window -// lparam: 0 -// return: 0 on success, 1 on error - MS_MW_ADDWINDOW = 'Utils/MagneticWindows/Add'; - -// For other Plugins to stop snapping for their windows -// wparam: hwnd of window -// lparam: 0 -// return: 0 on success, 1 on error - MS_MW_REMWINDOW = 'Utils/MagneticWindows/Rem'; - -//decide where to align on the list: - MS_MW_STL_List_Left = $00000001; //Snaps the window to the left border of the list - MS_MW_STL_List_Top = $00000002; //Snaps the window to the top border of the list - MS_MW_STL_List_Right = $00000004; //Snaps the window to the right border of the list - MS_MW_STL_List_Bottom = $00000008; //Snaps the window to the bottom border of the list -//decide with what side (of the window you want to snap) to snap to the list - MS_MW_STL_Wnd_Left = $00000010; //Snaps the window with the left border to the left/right side of the list - MS_MW_STL_Wnd_Top = $00000020; //Snaps the window with the top border to the top/bottom side of the list - MS_MW_STL_Wnd_Right = $00000040; //Snaps the window with the right border to the left/right side of the list - MS_MW_STL_Wnd_Bottom = $00000080; //Snaps the window with the bottom border to the top/bottom side of the list - - MS_MW_STL_Wnd_FullWidth = (MS_MW_STL_Wnd_Left or MS_MW_STL_Wnd_Right); - //Snaps to the top/bottom of the list and spans over the full width - - MS_MW_STL_Wnd_FullHeight = (MS_MW_STL_Wnd_Top or MS_MW_STL_Wnd_Bottom); - //Snaps to the left/right of the list and spans over the full height - -// to place the window in the list combine f.e. -// MS_MW_STL_List_Left | MS_MW_STL_Wnd_Right | *vetical alignment* - -//For other Plugins to snap a window to the list for other Plugins -// wparam: hwnd of window -// lparam: combination of the above constants MS_MW_STL_* -// return: 0 on success, 1 on error - MS_MW_SNAPTOLIST = 'Utils/MagneticWindows/SnapToList'; - -// Helper functions -{$IFNDEF MW_NO_HELPPER_FUNCTIONS} - -function MagneticWindows_AddWindow(hWnd:HWND):integer; -begin - if ServiceExists(MS_MW_ADDWINDOW)<>0 then - result:=CallService(MS_MW_ADDWINDOW,hWnd,0); - else - result:=-1; -end; - -function MagneticWindows_RemoveWindow(hWnd:HWND):integer; -begin - if ServiceExists(MS_MW_REMWINDOW)<>0 then - result:=CallService(MS_MW_REMWINDOW,hWnd,0); - else - result:=-1; -end; - -function MagneticWindows_SnapWindowToList(hWnd:HWND;MS_MW_STL_Options:integer):integer; -begin - if (ServiceExists(MS_MW_SNAPTOLIST)) - result:=CallService(MS_MW_SNAPTOLIST,hWnd,MS_MW_STL_Options); - else - result:=-1; -end; - -{$ENDIF} - -{$ENDIF} diff --git a/plugins/ExternalAPI/m_MagneticWindows.h b/plugins/ExternalAPI/m_MagneticWindows.h deleted file mode 100644 index e011c773fd..0000000000 --- a/plugins/ExternalAPI/m_MagneticWindows.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef __M_MAGNETICWINDOWS_H__ -#define __M_MAGNETICWINDOWS_H__ - -//#include "../include/newpluginapi.h" - -// For other Plugins to start snapping for their windows -// wparam: hwnd of window -// lparam: 0 -// return: 0 on success, 1 on error -#define MS_MW_ADDWINDOW "Utils/MagneticWindows/Add" - -// For other Plugins to stop snapping for their windows -// wparam: hwnd of window -// lparam: 0 -// return: 0 on success, 1 on error -#define MS_MW_REMWINDOW "Utils/MagneticWindows/Rem" - -//decide where to align on the list: -#define MS_MW_STL_List_Left 0x00000001 //Snaps the window to the left border of the list -#define MS_MW_STL_List_Top 0x00000002 //Snaps the window to the top border of the list -#define MS_MW_STL_List_Right 0x00000004 //Snaps the window to the right border of the list -#define MS_MW_STL_List_Bottom 0x00000008 //Snaps the window to the bottom border of the list -//decide with what side (of the window you want to snap) to snap to the list -#define MS_MW_STL_Wnd_Left 0x00000010 //Snaps the window with the left border to the left/right side of the list -#define MS_MW_STL_Wnd_Top 0x00000020 //Snaps the window with the top border to the top/bottom side of the list -#define MS_MW_STL_Wnd_Right 0x00000040 //Snaps the window with the right border to the left/right side of the list -#define MS_MW_STL_Wnd_Bottom 0x00000080 //Snaps the window with the bottom border to the top/bottom side of the list - -#define MS_MW_STL_Wnd_FullWidth (MS_MW_STL_Wnd_Left | MS_MW_STL_Wnd_Right) - //Snaps to the top/bottom of the list and spans over the full width - -#define MS_MW_STL_Wnd_FullHeight (MS_MW_STL_Wnd_Top | MS_MW_STL_Wnd_Bottom) - //Snaps to the left/right of the list and spans over the full height - -// to place the window in the list combine f.e. MS_MW_STL_List_Left | MS_MW_STL_Wnd_Right | *vetical alignment* - -//For other Plugins to snap a window to the list for other Plugins -// wparam: hwnd of window -// lparam: combination of the above constants MS_MW_STL_* -// return: 0 on success, 1 on error -#define MS_MW_SNAPTOLIST "Utils/MagneticWindows/SnapToList" - -// Helper functions -#ifndef _MW_NO_HELPPER_FUNCTIONS - - -static inline int MagneticWindows_AddWindow(HWND hWnd) -{ - if (ServiceExists(MS_MW_ADDWINDOW)) - { - return CallService(MS_MW_ADDWINDOW, (WPARAM) hWnd, 0); - } - else - { - return -1; - } -} - -static inline int MagneticWindows_RemoveWindow(HWND hWnd) -{ - if (ServiceExists(MS_MW_REMWINDOW)) - { - return CallService(MS_MW_REMWINDOW, (WPARAM) hWnd, 0); - } - else - { - return -1; - } -} - -static inline int MagneticWindows_SnapWindowToList(HWND hWnd, int MS_MW_STL_Options) -{ - if (ServiceExists(MS_MW_SNAPTOLIST)) - { - return CallService(MS_MW_SNAPTOLIST, (WPARAM) hWnd, (LPARAM) MS_MW_STL_Options); - } - else - { - return -1; - } -} - -#endif - - -#endif // __M_MAGNETICWINDOWS_H__ diff --git a/plugins/QuickContacts/src/commons.h b/plugins/QuickContacts/src/commons.h index a165d55010..a0577d8d72 100644 --- a/plugins/QuickContacts/src/commons.h +++ b/plugins/QuickContacts/src/commons.h @@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA. #include #include -#include #include #include diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 100cfe9b69..c11f9c91af 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -779,19 +779,17 @@ static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key) static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - switch (msg) - { - case WM_INITDIALOG: + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); { - TranslateDialogDefault(hwndDlg); - RECT rc; GetWindowRect(GetDlgItem(hwndDlg, IDC_USERNAME), &rc); ScreenToClient(hwndDlg, &rc); HWND icon = CreateWindow(_T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ICON | SS_CENTERIMAGE, - rc.left - 20, rc.top + (rc.bottom - rc.top - 16) / 2, 16, 16, hwndDlg, (HMENU) IDC_ICO, - hInst, NULL); + rc.left - 20, rc.top + (rc.bottom - rc.top - 16) / 2, 16, 16, hwndDlg, (HMENU) IDC_ICO, + hInst, NULL); if (!hasNewHotkeyModule) hAcct = LoadAccelerators(hInst, MAKEINTRESOURCE(ACCEL_TABLE)); @@ -824,8 +822,6 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETEXTENDEDUI, (WPARAM)TRUE, 0); - MagneticWindows_AddWindow(hwndDlg); - Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE_NAME, "window"); LoadContacts(hwndDlg, FALSE); @@ -843,252 +839,234 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA } SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - - return TRUE; } + return TRUE; - case WM_COMMAND: - { - switch(LOWORD(wParam)) + case WM_COMMAND: + switch(LOWORD(wParam)) { + case IDC_USERNAME: + if (HIWORD(wParam) == CBN_SELCHANGE) { - case IDC_USERNAME: - { - if (HIWORD(wParam) == CBN_SELCHANGE) - { - int pos = SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_GETCURSEL, 0, 0); - EnableButtons(hwndDlg, pos < contacts.getCount() ? contacts[pos]->hcontact : NULL); - } + int pos = SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_GETCURSEL, 0, 0); + EnableButtons(hwndDlg, pos < contacts.getCount() ? contacts[pos]->hcontact : NULL); + } + break; + + case IDC_ENTER: + { + HANDLE hContact = GetSelectedContact(hwndDlg); + if (hContact == NULL) break; - } - case IDC_ENTER: - { - HANDLE hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - break; - CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM) hContact, 0); + CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM) hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - SendMessage(hwndDlg, WM_CLOSE, 0, 0); + db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + } + break; + case IDC_MESSAGE: + { + HANDLE hContact = GetSelectedContact(hwndDlg); + if (hContact == NULL) + { + SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); + SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); break; } - case IDC_MESSAGE: - { - HANDLE hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - break; - } - // Is button enabled? - if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MESSAGE))) - break; + // Is button enabled? + if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MESSAGE))) + break; - CallService(MS_MSG_SENDMESSAGET, (WPARAM) hContact, 0); + CallService(MS_MSG_SENDMESSAGET, (WPARAM) hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - SendMessage(hwndDlg, WM_CLOSE, 0, 0); + db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + break; + } + case HOTKEY_VOICE: + case IDC_VOICE: + { + HANDLE hContact = GetSelectedContact(hwndDlg); + if (hContact == NULL) + { + SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); + SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); break; } - case HOTKEY_VOICE: - case IDC_VOICE: - { - HANDLE hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - break; - } - // Is button enabled? - if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VOICE))) - break; + // Is button enabled? + if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VOICE))) + break; - if (!ServiceExists(MS_VOICESERVICE_CALL)) - break; + if (!ServiceExists(MS_VOICESERVICE_CALL)) + break; - CallService(MS_VOICESERVICE_CALL, (WPARAM) hContact, 0); + CallService(MS_VOICESERVICE_CALL, (WPARAM) hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - SendMessage(hwndDlg, WM_CLOSE, 0, 0); + db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + break; + } + case HOTKEY_FILE: + case IDC_FILE: + { + HANDLE hContact = GetSelectedContact(hwndDlg); + if (hContact == NULL) + { + SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); + SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); break; } - case HOTKEY_FILE: - case IDC_FILE: - { - HANDLE hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - break; - } - // Is button enabled? - if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FILE))) - break; + // Is button enabled? + if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FILE))) + break; - CallService(MS_FILE_SENDFILE, (WPARAM) hContact, 0); + CallService(MS_FILE_SENDFILE, (WPARAM) hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - SendMessage(hwndDlg, WM_CLOSE, 0, 0); + db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + break; + } + case HOTKEY_URL: + case IDC_URL: + { + HANDLE hContact = GetSelectedContact(hwndDlg); + if (hContact == NULL) + { + SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); + SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); break; } - case HOTKEY_URL: - case IDC_URL: - { - HANDLE hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - break; - } - // Is button enabled? - if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_URL))) - break; + // Is button enabled? + if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_URL))) + break; - CallService(MS_URL_SENDURL, (WPARAM) hContact, 0); + CallService(MS_URL_SENDURL, (WPARAM) hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - SendMessage(hwndDlg, WM_CLOSE, 0, 0); + db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + break; + } + case HOTKEY_INFO: + case IDC_USERINFO: + { + HANDLE hContact = GetSelectedContact(hwndDlg); + if (hContact == NULL) + { + SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); + SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); break; } - case HOTKEY_INFO: - case IDC_USERINFO: - { - HANDLE hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - break; - } - // Is button enabled? - if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_USERINFO))) - break; + // Is button enabled? + if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_USERINFO))) + break; - CallService(MS_USERINFO_SHOWDIALOG, (WPARAM) hContact, 0); + CallService(MS_USERINFO_SHOWDIALOG, (WPARAM) hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - SendMessage(hwndDlg, WM_CLOSE, 0, 0); + db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + break; + } + case HOTKEY_HISTORY: + case IDC_HISTORY: + { + HANDLE hContact = GetSelectedContact(hwndDlg); + if (hContact == NULL) + { + SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); + SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); break; } - case HOTKEY_HISTORY: - case IDC_HISTORY: - { - HANDLE hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - break; - } - // Is button enabled? - if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_HISTORY))) - break; + // Is button enabled? + if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_HISTORY))) + break; - CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM) hContact, 0); + CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM) hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - SendMessage(hwndDlg, WM_CLOSE, 0, 0); + db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + break; + } + case HOTKEY_MENU: + case IDC_MENU: + { + HANDLE hContact = GetSelectedContact(hwndDlg); + if (hContact == NULL) + { + SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); + SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); break; } - case HOTKEY_MENU: - case IDC_MENU: - { - HANDLE hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - break; - } - - // Is button enabled? - if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MENU))) - break; - RECT rc; - GetWindowRect(GetDlgItem(hwndDlg, IDC_MENU), &rc); - HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM) hContact, 0); - int ret = TrackPopupMenu(hMenu, TPM_TOPALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL); - DestroyMenu(hMenu); + // Is button enabled? + if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MENU))) + break; - if(ret) - { - SendMessage(hwndDlg, WM_CLOSE, 0, 0); - CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(ret),MPCF_CONTACTMENU),(LPARAM) hContact); - } + RECT rc; + GetWindowRect(GetDlgItem(hwndDlg, IDC_MENU), &rc); + HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM) hContact, 0); + int ret = TrackPopupMenu(hMenu, TPM_TOPALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL); + DestroyMenu(hMenu); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - break; - } - case HOTKEY_ALL_CONTACTS: - case IDC_SHOW_ALL_CONTACTS: + if(ret) { - // Get old text - HWND hEdit = GetWindow(GetWindow(hwndDlg,GW_CHILD),GW_CHILD); - TCHAR sztext[120] = _T(""); + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(ret),MPCF_CONTACTMENU),(LPARAM) hContact); + } - if (SendMessage(hEdit, EM_GETSEL, 0, 0) != -1) - SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)_T("")); + db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); + break; + } + case HOTKEY_ALL_CONTACTS: + case IDC_SHOW_ALL_CONTACTS: + { + // Get old text + HWND hEdit = GetWindow(GetWindow(hwndDlg,GW_CHILD),GW_CHILD); + TCHAR sztext[120] = _T(""); - SendMessage(hEdit, WM_GETTEXT, (WPARAM)SIZEOF(sztext), (LPARAM)sztext); + if (SendMessage(hEdit, EM_GETSEL, 0, 0) != -1) + SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)_T("")); - // Fill combo - BOOL all = IsDlgButtonChecked(hwndDlg, IDC_SHOW_ALL_CONTACTS); + SendMessage(hEdit, WM_GETTEXT, (WPARAM)SIZEOF(sztext), (LPARAM)sztext); - if (LOWORD(wParam) == HOTKEY_ALL_CONTACTS) - { - // Toggle checkbox - all = !all; - CheckDlgButton(hwndDlg, IDC_SHOW_ALL_CONTACTS, all ? BST_CHECKED : BST_UNCHECKED); - } + // Fill combo + BOOL all = IsDlgButtonChecked(hwndDlg, IDC_SHOW_ALL_CONTACTS); + + if (LOWORD(wParam) == HOTKEY_ALL_CONTACTS) + { + // Toggle checkbox + all = !all; + CheckDlgButton(hwndDlg, IDC_SHOW_ALL_CONTACTS, all ? BST_CHECKED : BST_UNCHECKED); + } - LoadContacts(hwndDlg, all); + LoadContacts(hwndDlg, all); - // Return selection - CheckText(hEdit, sztext); + // Return selection + CheckText(hEdit, sztext); - break; - } + break; } - - break; } + break; - case WM_CLOSE: - { - Utils_SaveWindowPosition(hwndDlg, NULL, MODULE_NAME, "window"); - MagneticWindows_RemoveWindow(hwndDlg); - DestroyWindow(hwndDlg); - break; - } + case WM_CLOSE: + Utils_SaveWindowPosition(hwndDlg, NULL, MODULE_NAME, "window"); + DestroyWindow(hwndDlg); + break; - case WM_DESTROY: - { - UnhookWindowsHookEx(hHook); - hwndMain = NULL; - FreeContacts(); - InterlockedExchange(&main_dialog_open, 0); - break; - } + case WM_DESTROY: + UnhookWindowsHookEx(hHook); + hwndMain = NULL; + FreeContacts(); + InterlockedExchange(&main_dialog_open, 0); + break; - case WM_NCLBUTTONDBLCLK: - { - MagneticWindows_SnapWindowToList(hwndDlg, MS_MW_STL_List_Left | MS_MW_STL_List_Top - | MS_MW_STL_Wnd_Right | MS_MW_STL_Wnd_Top); - break; - } - - case WM_DRAWITEM: + case WM_DRAWITEM: { // add icons and protocol to listbox LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam; @@ -1122,7 +1100,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA rc.left = lpdis->rcItem.left + 5; rc.top = (lpdis->rcItem.bottom + lpdis->rcItem.top - icon_height) / 2; ImageList_Draw(hIml, CallService(MS_CLIST_GETCONTACTICON, (WPARAM)contacts[lpdis->itemData]->hcontact, 0), - lpdis->hDC, rc.left, rc.top, ILD_NORMAL); + lpdis->hDC, rc.left, rc.top, ILD_NORMAL); // Make rect for text rc.left += icon_width + 5; @@ -1142,7 +1120,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA RECT rcc = { 0, 0, 0x7FFF, 0x7FFF }; DrawText(lpdis->hDC, contacts[loop]->proto, lstrlen(contacts[loop]->proto), - &rcc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE | DT_CALCRECT); + &rcc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE | DT_CALCRECT); max_proto_width = max(max_proto_width, rcc.right - rcc.left); } @@ -1160,7 +1138,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA rc_tmp.left = rc_tmp.right - max_proto_width; DrawText(lpdis->hDC, contacts[lpdis->itemData]->proto, lstrlen(contacts[lpdis->itemData]->proto), - &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE); + &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE); rc.right = rc_tmp.left - 5; } @@ -1182,7 +1160,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA } DrawText(lpdis->hDC, contacts[lpdis->itemData]->szgroup, lstrlen(contacts[lpdis->itemData]->szgroup), - &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE); + &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE); } // Draw text @@ -1197,11 +1175,10 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA // Restore old colors SetTextColor(lpdis->hDC, clrfore); SetBkColor(lpdis->hDC, clrback); - - return TRUE; } + return TRUE; - case WM_MEASUREITEM: + case WM_MEASUREITEM: { LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT)lParam; @@ -1223,11 +1200,11 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ImageList_GetIconSize(hIml, &icon_width, &icon_height); lpmis->itemHeight = max(icon_height, tm.tmHeight); - + return TRUE; } } - + return FALSE; } @@ -1245,7 +1222,7 @@ INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) // Show it SetForegroundWindow(hwndMain); SetFocus(hwndMain); - ShowWindow(hwndMain, SW_SHOW); + ShowWindow(hwndMain, SW_SHOW); return 0; } -- cgit v1.2.3