I have a modeless CExtResizableDialog with a CExtToolControlBar. It works fine when the dialog’s parent is AfxGetMainWnd() but I want the dialog to be behind the main window when the main window has focus. To do this I changed the parent to CWnd::GetDesktopWindow(). But then the buttons are blank. (They work but the images aren’t there.)
Here’s what I do in OnInitDialog()
m_wndToolBar.LoadToolBar(IDR_DOXLST_BAR);
RDrwDpiGet(&nDpiX, &nDpiY);
::SetRect(&rectWork, 0, 0, (int)(2.25*nDpiX), nDpiY);
VERIFY(m_cmbBarDrag.Create(
WS_CHILD|WS_VISIBLE|WS_TABSTOP|CBS_DROPDOWNLIST|CBS_HASSTRINGS,
rectWork, &m_wndToolBar, ID_DOXLST_CMB_DRAG));
VERIFY(m_wndToolBar.SetButtonCtrl(
m_wndToolBar.CommandToIndex(ID_DOXLST_CMB_DRAG), &m_cmbBarDrag));
m_wndToolBar.m_bForceBalloonGradientInDialogs = true;
And then this in DoDataExchange()
DDX_Control(pDX, IDR_DOXLST_BAR, m_wndToolBar);
Those are the only refernces to the toolbar