Cyril ZEKSER
March 25th, 1998, 10:12 AM
If you want to have the ON_UPDATE_CMD_UI called, just do the two following things :
1. Derive you toolbar from CToolBar, to add the hanfdler for WM_IDLEUPDATECMDUI (as shown in MFC code for CFrameWnd) but, before calling the parent's function, cast the this pointer to CFrameWnd*,
2. Override the CDialog::ContinueModal() that way...
BOOL CMyDialog::ContinueModal()
{
m_wndMyToolBar.SendMessage(WM_IDLEUPDATECMDUI, (WPARAM)TRUE, 0);
return CDialog::ContinueModal();
}
It is valid since the RunModalLoop (in wincore.cpp) call ContinueModal at the end of each task. (sound like EnterIdle no? )
Then your handlers of ON_UPDATE_CMD_UI of your dialog toolbar buttons are called....
that's all...
1. Derive you toolbar from CToolBar, to add the hanfdler for WM_IDLEUPDATECMDUI (as shown in MFC code for CFrameWnd) but, before calling the parent's function, cast the this pointer to CFrameWnd*,
2. Override the CDialog::ContinueModal() that way...
BOOL CMyDialog::ContinueModal()
{
m_wndMyToolBar.SendMessage(WM_IDLEUPDATECMDUI, (WPARAM)TRUE, 0);
return CDialog::ContinueModal();
}
It is valid since the RunModalLoop (in wincore.cpp) call ContinueModal at the end of each task. (sound like EnterIdle no? )
Then your handlers of ON_UPDATE_CMD_UI of your dialog toolbar buttons are called....
that's all...