Discussion:
wxDialog icon in the taskbar
dainius
2014-06-12 11:29:06 UTC
Permalink
Hello, I have a problem with wxDialog icon in the taskbar.

I'm using mfc wx sample with turned on flag START_WITH_MFC_WINDOW.

wxDialog run code:

HWND hParent = AfxGetApp()->GetMainWnd()->GetSafeHwnd();
wxWindow *pParent = new wxFrame;
pParent->SetHWND((WXHWND)hParent);
pParent->AdoptAttributesFromHWND();

wxDialog dlg(pParent, wxID_ANY, wxT("DLG"), wxDefaultPosition,
wxSize(600,730), wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);

dlg.ShowModal();



And after this I get two icons in the taskbar: one for the sample
application, and the other one - for the wxDialog.

Question: how to remove wxDialog icon from the taskbar?

(Real application is in MFC. Only modal dialogs is created with wxDialog)
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
dainius
2014-06-16 14:33:10 UTC
Permalink
Found solution by myself:

//Prepare parent from FMC HWND
HWND hParent = AfxGetApp()->GetMainWnd()->GetSafeHwnd();
wxWindow *pParent = new wxWindow;
pParent->SetHWND((WXHWND)hParent);
pParent->AdoptAttributesFromHWND();
wxTopLevelWindows.Append(pParent);

//Run Dialog
wxDialog *dlg = new wxDialog(pParent, wxID_ANY, wxT("DLG"),
wxDefaultPosition, wxSize(600,730), wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
dlg->ShowModal();
delete dlg;

//Destroy temp parent
if(!wxTopLevelWindows.DeleteObject(pParent))
{
ASSERT(FALSE);
}

pParent->SetHWND((WXHWND)NULL);
delete pParent;

Is there some hidden problems with wxTopLevelWindows usage?
Post by dainius
Hello, I have a problem with wxDialog icon in the taskbar.
I'm using mfc wx sample with turned on flag START_WITH_MFC_WINDOW.
HWND hParent = AfxGetApp()->GetMainWnd()->GetSafeHwnd();
wxWindow *pParent = new wxFrame;
pParent->SetHWND((WXHWND)hParent);
pParent->AdoptAttributesFromHWND();
wxDialog dlg(pParent, wxID_ANY, wxT("DLG"), wxDefaultPosition,
wxSize(600,730), wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
dlg.ShowModal();
And after this I get two icons in the taskbar: one for the sample
application, and the other one - for the wxDialog.
Question: how to remove wxDialog icon from the taskbar?
(Real application is in MFC. Only modal dialogs is created with wxDialog)
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
dainius
2014-06-16 14:33:52 UTC
Permalink
Found solution by myself:

//Prepare parent from FMC HWND
HWND hParent = AfxGetApp()->GetMainWnd()->GetSafeHwnd();
wxWindow *pParent = new wxWindow;
pParent->SetHWND((WXHWND)hParent);
pParent->AdoptAttributesFromHWND();
wxTopLevelWindows.Append(pParent);

//Run Dialog
wxDialog *dlg = new wxDialog(pParent, wxID_ANY, wxT("DLG"),
wxDefaultPosition, wxSize(600,730), wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
dlg->ShowModal();
delete dlg;

//Destroy temp parent
if(!wxTopLevelWindows.DeleteObject(pParent))
{
ASSERT(FALSE);
}

pParent->SetHWND((WXHWND)NULL);
delete pParent;

Is there some hidden problems with wxTopLevelWindows usage?
Post by dainius
Hello, I have a problem with wxDialog icon in the taskbar.
I'm using mfc wx sample with turned on flag START_WITH_MFC_WINDOW.
HWND hParent = AfxGetApp()->GetMainWnd()->GetSafeHwnd();
wxWindow *pParent = new wxFrame;
pParent->SetHWND((WXHWND)hParent);
pParent->AdoptAttributesFromHWND();
wxDialog dlg(pParent, wxID_ANY, wxT("DLG"), wxDefaultPosition,
wxSize(600,730), wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
dlg.ShowModal();
And after this I get two icons in the taskbar: one for the sample
application, and the other one - for the wxDialog.
Question: how to remove wxDialog icon from the taskbar?
(Real application is in MFC. Only modal dialogs is created with wxDialog)
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...