diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-04 07:23:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-04 07:23:42 +0000 |
commit | 66cb770a982a2502456d10d73838df2b7239fd89 (patch) | |
tree | fc419dde94a9be3ebe8f2266ff46feb90d2bcbec /plugins/QuickContacts | |
parent | bc256df33a57e585367edffe33d3e58d53f82ce8 (diff) |
new subclassing functions applied to all plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@3880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/QuickContacts')
-rw-r--r-- | plugins/QuickContacts/src/quickcontacts.cpp | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 6ee218d4d2..000af4664c 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -601,16 +601,13 @@ int GetItemPos(HANDLE hcontact) }
-WNDPROC wpEditMainProc;
-
// callback function for edit-box of the listbox
// without this the autofill function isn't possible
// this was done like ie does it..as far as spy++ could tell ;)
LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
- switch(msg)
- {
- case WM_CHAR:
+ switch(msg) {
+ case WM_CHAR:
{
if (wparam<32 && wparam != VK_BACK)
break;
@@ -648,7 +645,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) return 1;
}
- case WM_KEYUP:
+ case WM_KEYUP:
{
TCHAR sztext[120] = _T("");
@@ -656,13 +653,13 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) {
switch(SendMessage(GetParent(hdlg),CB_GETDROPPEDSTATE,0,0))
{
- case FALSE:
- SendMessage(GetParent(GetParent(hdlg)),WM_COMMAND,MAKEWPARAM(IDC_ENTER,STN_CLICKED),0);
- break;
+ case FALSE:
+ SendMessage(GetParent(GetParent(hdlg)),WM_COMMAND,MAKEWPARAM(IDC_ENTER,STN_CLICKED),0);
+ break;
- case TRUE:
- SendMessage(GetParent(hdlg),CB_SHOWDROPDOWN,(WPARAM)FALSE,0);
- break;
+ case TRUE:
+ SendMessage(GetParent(hdlg),CB_SHOWDROPDOWN,(WPARAM)FALSE,0);
+ break;
}
}
else if (wparam == VK_DELETE)
@@ -673,15 +670,14 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) return 0;
}
- case WM_GETDLGCODE:
- return DLGC_WANTCHARS|DLGC_WANTARROWS;
+ case WM_GETDLGCODE:
+ return DLGC_WANTCHARS|DLGC_WANTARROWS;
}
- return CallWindowProc(wpEditMainProc,hdlg,msg,wparam,lparam);
+ return mir_callNextSubclass(hdlg, EditProc, msg, wparam, lparam);
}
-
HACCEL hAcct;
HHOOK hHook;
@@ -694,9 +690,7 @@ LRESULT CALLBACK HookProc(int code, WPARAM wparam, LPARAM lparam) MSG *msg = (MSG*)lparam;
-
- if (hasNewHotkeyModule)
- {
+ if (hasNewHotkeyModule) {
int action = CallService(MS_HOTKEY_CHECK, (WPARAM) msg, (LPARAM) "Quick Contacts");
if (action != 0)
{
@@ -704,8 +698,7 @@ LRESULT CALLBACK HookProc(int code, WPARAM wparam, LPARAM lparam) return 1;
}
}
- else
- {
+ else {
HWND htemp = msg->hwnd;
msg->hwnd = hwndMain;
@@ -715,17 +708,15 @@ LRESULT CALLBACK HookProc(int code, WPARAM wparam, LPARAM lparam) msg->hwnd=htemp;
}
- if (msg->message == WM_KEYDOWN && msg->wParam == VK_ESCAPE)
- {
- switch(SendMessage(GetDlgItem(hwndMain, IDC_USERNAME), CB_GETDROPPEDSTATE, 0, 0))
- {
- case FALSE:
- SendMessage(hwndMain, WM_CLOSE, 0, 0);
- break;
+ if (msg->message == WM_KEYDOWN && msg->wParam == VK_ESCAPE) {
+ switch(SendMessage(GetDlgItem(hwndMain, IDC_USERNAME), CB_GETDROPPEDSTATE, 0, 0)) {
+ case FALSE:
+ SendMessage(hwndMain, WM_CLOSE, 0, 0);
+ break;
- case TRUE:
- SendMessage(GetDlgItem(hwndMain, IDC_USERNAME), CB_SHOWDROPDOWN, (WPARAM)FALSE, 0);
- break;
+ case TRUE:
+ SendMessage(GetDlgItem(hwndMain, IDC_USERNAME), CB_SHOWDROPDOWN, (WPARAM)FALSE, 0);
+ break;
}
}
@@ -818,7 +809,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA // Combo
SendMessage(GetDlgItem(hwndDlg, IDC_USERNAME), EM_LIMITTEXT, (WPARAM)119,0);
- wpEditMainProc = (WNDPROC) SetWindowLongPtr(GetWindow(GetDlgItem(hwndDlg, IDC_USERNAME),GW_CHILD), GWLP_WNDPROC, (LONG)EditProc);
+ mir_subclassWindow(GetWindow(GetDlgItem(hwndDlg, IDC_USERNAME),GW_CHILD), EditProc);
// Buttons
FillCheckbox(hwndDlg, IDC_SHOW_ALL_CONTACTS, LPGENT("Show all contacts"), hasNewHotkeyModule ? NULL : LPGENT("Ctrl+A"));
|