diff --git a/include/wx/msw/filedlg.h b/include/wx/msw/filedlg.h index d2ba87a54f..e516bda634 100644 --- a/include/wx/msw/filedlg.h +++ b/include/wx/msw/filedlg.h @@ -58,7 +58,7 @@ private: void MSWOnSelChange(WXHWND hDlg); // called from the hook procedure on CDN_TYPECHANGE. - void MSWOnTypeChange(WXHWND hDlg, int nFilterIndex); + void MSWOnTypeChange(int nFilterIndex); // The real implementation of ShowModal() using traditional common dialog // functions. diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 4b831007dc..ee7b53e81f 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -194,12 +194,10 @@ wxFileDialogMSWData::HookFunction(HWND hDlg, NMHDR* const pNM = reinterpret_cast(lParam); if ( pNM->code > CDN_LAST && pNM->code <= CDN_FIRST ) { - OFNOTIFY* const - pNotifyCode = reinterpret_cast(lParam); + const OPENFILENAME& + ofn = *reinterpret_cast(lParam)->lpOFN; wxFileDialog* const - dialog = reinterpret_cast( - pNotifyCode->lpOFN->lCustData - ); + dialog = reinterpret_cast(ofn.lCustData); switch ( pNM->code ) { @@ -212,11 +210,7 @@ wxFileDialogMSWData::HookFunction(HWND hDlg, break; case CDN_TYPECHANGE: - dialog->MSWOnTypeChange - ( - (WXHWND)hDlg, - pNotifyCode->lpOFN->nFilterIndex - ); + dialog->MSWOnTypeChange(ofn.nFilterIndex); break; } } @@ -397,7 +391,7 @@ void wxFileDialog::MSWOnSelChange(WXHWND hDlg) UpdateExtraControlUI(); } -void wxFileDialog::MSWOnTypeChange(WXHWND WXUNUSED(hDlg), int nFilterIndex) +void wxFileDialog::MSWOnTypeChange(int nFilterIndex) { // Filter indices are 1-based, while we want to use 0-based index, as // usual. However the input index can apparently also be 0 in some