how checking/unchecking in a popupmenu
for checking or unchecking.
how making?
my popupmenu is initialised in class CDialog:
int CClrBgDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
// assign a menu, icon, tooltip, and handler to the tray icon.
if ( ! m_classTrayNotifyIcon . Create ( this, IDR_POPUP, "ClearBg", AfxGetApp () -> LoadIcon ( IDI_TRAYICON ), WM_TRAYNOTIFY ) ) {
AfxMessageBox ( "Failure Creating Tray Icon", MB_ICONSTOP );
return -1;
}
return 0;
}
// pass the tray notification message to the tray icon object for handling.
LRESULT CClrBgDlg::OnTrayNotify ( WPARAM wParam, LPARAM lParam ) {
return m_classTrayNotifyIcon . OnTrayNotification ( wParam, lParam );
SetForegroundWindow();
}
void CMyDlg::OnUpdateHideIconsDesk(CCmdUI* pCmdUI)
{
if(t_icon == TRUE) pCmdUI->SetCheck(1);
else
if(t_icon == FALSE) pCmdUI->SetCheck(0);
}
rc file:
IDR_POPUP MENU DISCARDABLE
BEGIN
POPUP "P&OPUP"
BEGIN
MENUITEM "&Dialog Properties...", IDC_SHOW_MAIN
MENUITEM SEPARATOR
MENUITEM "C&hoose Colors...", IDC_COLOR
MENUITEM "&Hide/Show Icon", IDC_HIDE_ICONS
MENUITEM "&About ClearBg...", ID_APP_ABOUT
MENUITEM SEPARATOR
MENUITEM "&Remove From Memory...", IDC_REMOVE_MEMORY
END
END

