diff options
Diffstat (limited to 'src/core/stdfile')
-rw-r--r-- | src/core/stdfile/fileexistsdlg.cpp | 21 | ||||
-rw-r--r-- | src/core/stdfile/filesenddlg.cpp | 30 |
2 files changed, 24 insertions, 27 deletions
diff --git a/src/core/stdfile/fileexistsdlg.cpp b/src/core/stdfile/fileexistsdlg.cpp index 4efb73ebfb..8729229462 100644 --- a/src/core/stdfile/fileexistsdlg.cpp +++ b/src/core/stdfile/fileexistsdlg.cpp @@ -112,24 +112,23 @@ static void DoAnnoyingShellCommand(HWND hwnd, const TCHAR *szFilename, int cmd, }
}
-static WNDPROC pfnIconWindowProc;
static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
PROTOFILETRANSFERSTATUS* pft = (PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
switch(msg) {
- case WM_LBUTTONDBLCLK:
- ShellExecute(hwnd, NULL, pft->tszCurrentFile, NULL, NULL, SW_SHOW);
- break;
- case WM_RBUTTONUP:
+ case WM_LBUTTONDBLCLK:
+ ShellExecute(hwnd, NULL, pft->tszCurrentFile, NULL, NULL, SW_SHOW);
+ break;
+ case WM_RBUTTONUP:
{ POINT pt;
- pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
- ClientToScreen(hwnd, &pt);
- DoAnnoyingShellCommand(hwnd, pft->tszCurrentFile, C_CONTEXTMENU, &pt);
- return 0;
+ pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
+ ClientToScreen(hwnd, &pt);
+ DoAnnoyingShellCommand(hwnd, pft->tszCurrentFile, C_CONTEXTMENU, &pt);
+ return 0;
}
}
- return CallWindowProc(pfnIconWindowProc, hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, IconCtrlSubclassProc, msg, wParam, lParam);
}
struct loadiconsstartinfo {
@@ -215,7 +214,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM GetSensiblyFormattedSize(fts->currentFileSize, szSize, SIZEOF(szSize), 0, 1, NULL);
SetDlgItemText(hwndDlg, IDC_NEWSIZE, szSize);
- pfnIconWindowProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXISTINGICON), GWLP_WNDPROC, (LONG_PTR)IconCtrlSubclassProc);
+ mir_subclassWindow( GetDlgItem(hwndDlg, IDC_EXISTINGICON), IconCtrlSubclassProc);
hwndFocus = GetDlgItem(hwndDlg, IDC_RESUME);
if (_tstati64(fts->tszCurrentFile, &statbuf) == 0) {
diff --git a/src/core/stdfile/filesenddlg.cpp b/src/core/stdfile/filesenddlg.cpp index 4523c63b36..e41670889b 100644 --- a/src/core/stdfile/filesenddlg.cpp +++ b/src/core/stdfile/filesenddlg.cpp @@ -170,24 +170,23 @@ static BOOL CALLBACK ClipSiblingsChildEnumProc(HWND hwnd, LPARAM) return TRUE;
}
-static WNDPROC OldSendEditProc;
static LRESULT CALLBACK SendEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg) {
- case WM_CHAR:
- if (wParam == '\n' && GetKeyState(VK_CONTROL)&0x8000) {
- PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
- return 0;
- }
- break;
- case WM_SYSCHAR:
- if ((wParam == 's' || wParam == 'S') && GetKeyState(VK_MENU)&0x8000) {
- PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
- return 0;
- }
- break;
+ case WM_CHAR:
+ if (wParam == '\n' && GetKeyState(VK_CONTROL)&0x8000) {
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
+ return 0;
+ }
+ break;
+ case WM_SYSCHAR:
+ if ((wParam == 's' || wParam == 'S') && GetKeyState(VK_MENU)&0x8000) {
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
+ return 0;
+ }
+ break;
}
- return CallWindowProc(OldSendEditProc, hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, SendEditSubclassProc, msg, wParam, lParam);
}
INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -210,7 +209,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TranslateDialogDefault(hwndDlg);
EnumChildWindows(hwndDlg, ClipSiblingsChildEnumProc, 0);
- OldSendEditProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
+ mir_subclassWindow( GetDlgItem(hwndDlg, IDC_MSG), SendEditSubclassProc);
Window_SetIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE);
Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View User's Details"));
@@ -349,7 +348,6 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (dat)
FreeFileDlgData(dat);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)OldSendEditProc);
return TRUE;
}
return FALSE;
|