diff --git a/Common/Dialog.cpp b/Common/Dialog.cpp index 5809f217..a4eccb61 100644 --- a/Common/Dialog.cpp +++ b/Common/Dialog.cpp @@ -35,7 +35,7 @@ CBaseDialog::CBaseDialog() : ** Create (if not already) and show the dialog. ** */ -void CBaseDialog::Show(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent) +void CBaseDialog::Show(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent, bool modeless) { if (m_Window) { @@ -86,7 +86,14 @@ void CBaseDialog::Show(const WCHAR* title, short x, short y, short w, short h, D // Font array. memcpy(dtExtra, font, fontSize); - CreateDialogIndirectParam(NULL, dt, parent, InitialDlgProc, (LPARAM)this); + if (modeless) + { + CreateDialogIndirectParam(NULL, dt, parent, InitialDlgProc, (LPARAM)this); + } + else + { + DialogBoxIndirectParam(NULL, dt, parent, InitialDlgProc, (LPARAM)this); + } delete [] dt; } @@ -140,9 +147,9 @@ CDialog::~CDialog() DeleteObject(m_FontBold); } -void CDialog::ShowDialogWindow(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent) +void CDialog::ShowDialogWindow(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent, bool modeless) { - Show(title, x, y, w, h, style, exStyle, parent); + Show(title, x, y, w, h, style, exStyle, parent, modeless); } INT_PTR CDialog::OnActivate(WPARAM wParam, LPARAM lParam) @@ -232,7 +239,7 @@ void CDialog::CTab::CreateTabWindow(short x, short y, short w, short h, HWND own { const DWORD style = DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS; const DWORD exStyle = WS_EX_CONTROLPARENT; - Show(L"", x, y, w, h, style, exStyle, owner); + Show(L"", x, y, w, h, style, exStyle, owner, true); EnableThemeDialogTexture(m_Window, ETDT_ENABLETAB); } diff --git a/Common/Dialog.h b/Common/Dialog.h index cd80f60d..d7974889 100644 --- a/Common/Dialog.h +++ b/Common/Dialog.h @@ -32,7 +32,7 @@ protected: CBaseDialog(); virtual ~CBaseDialog() {} - void Show(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent); + void Show(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent, bool modeless); void CreateControls(const ControlTemplate::Control* cts, UINT ctCount, HFONT font, ControlTemplate::GetStringFunc getString); @@ -77,7 +77,7 @@ protected: CDialog(); virtual ~CDialog(); - void ShowDialogWindow(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent); + void ShowDialogWindow(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent, bool modeless = true); INT_PTR OnActivate(WPARAM wParam, LPARAM lParam);