VC++程序中如何获取任务栏关闭程序消息

2025-01-21 12:07:52
推荐回答(1个)
回答1:

CMenu menu; BOOL b_test = menu.CreatePopupMenu(); if(!b_test) return 0; menu.AppendMenu(0, IDM_CLEAN, _T("clean")); menu.AppendMenu(0, IDM_EXIT, _T("exit")); menu.EnableMenuItem(IDM_CLEAN, MF_BYCOMMAND); menu.EnableMenuItem(IDM_EXIT, MF_BYCOMMAND); SetForegroundWindow(); menu.TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this);