X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6fa6d65956285379aa1d99b76d92db76aaecf11e..4209475ced5240eb3ce516767e7c9a0a74d12bc7:/src/msw/filedlg.cpp?ds=sidebyside diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 7b5ac99870..c553328fb4 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -86,6 +86,7 @@ wxFileDialogHookFunction(HWND hDlg, { switch ( iMsg ) { +#ifndef __WXWINCE__ case WM_INITDIALOG: { OPENFILENAME* ofn = reinterpret_cast(lParam); @@ -93,6 +94,7 @@ wxFileDialogHookFunction(HWND hDlg, ->MSWOnInitDialogHook((WXHWND)hDlg); } break; +#endif // __WXWINCE__ case WM_NOTIFY: { @@ -368,6 +370,7 @@ static bool ShowCommFileDialog(OPENFILENAME *of, long style) return true; } +#ifndef __WXWINCE__ void wxFileDialog::MSWOnInitDialogHook(WXHWND hwnd) { SetHWND(hwnd); @@ -376,6 +379,7 @@ void wxFileDialog::MSWOnInitDialogHook(WXHWND hwnd) SetHWND(NULL); } +#endif // __WXWINCE__ int wxFileDialog::ShowModal() { @@ -455,12 +459,11 @@ int wxFileDialog::ShowModal() lpdt->x = 0; lpdt->y = 0; - wxSize extra_size = GetExtraControlSize(); - // setting cx doesn't change the width of the dialog - lpdt->cx = extra_size.GetWidth(); - // Dividing by 2 gives expected height on WinXP and Wine. - // I don't know why (MW). - lpdt->cy = extra_size.GetHeight() / 2; + // convert the size of the extra controls to the dialog units + const wxSize extraSize = GetExtraControlSize(); + const LONG baseUnits = ::GetDialogBaseUnits(); + lpdt->cx = ::MulDiv(extraSize.x, 4, LOWORD(baseUnits)); + lpdt->cy = ::MulDiv(extraSize.y, 8, HIWORD(baseUnits)); // after the DLGTEMPLATE there are 3 additional WORDs for dialog menu, // class and title, all three set to zeros.