diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index fb454b7953..129cd47b39 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -153,9 +153,12 @@ void wxGenericProgressDialog::Create( const wxString& title, wxWindow *parent, int style ) { - wxDialog::Create(GetParentForModalDialog(parent, style), wxID_ANY, title); + // Notice that GetParentForModalDialog() needs the dialog window style, not + // our wxProgressDialog-specific style. + wxWindow* const + realParent = GetParentForModalDialog(parent, GetWindowStyle()); + wxDialog::Create(realParent, wxID_ANY, title); - SetParent( GetParentForModalDialog(parent, style) ); SetTitle( title ); SetMaximum(maximum); diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 0cb869aa2e..f51c879901 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -316,6 +316,7 @@ wxProgressDialog::wxProgressDialog( const wxString& title, #ifdef wxHAS_MSW_TASKDIALOG if ( HasNativeTaskDialog() ) { + SetParent(GetParentForModalDialog(parent, GetWindowStyle())); SetMaximum(maximum); Show();