现在的代码如下,是用鼠标实现的
LRESULT CAgentDlg::OnTaskIconNotify(WPARAM wParam, LPARAM lParam)
{
POINT point; if (wParam == TASKICONNOTIFYID)
{
switch(lParam)
{
case WM_RBUTTONUP:
::GetCursorPos(&point);
::SetForegroundWindow(GetSafeHwnd());
//状態設定
popupMenu->EnableMenuItem(ID_CONNECT, commo.isconnect() ? MF_GRAYED : MF_ENABLED);
LRESULT CAgentDlg::OnTaskIconNotify(WPARAM wParam, LPARAM lParam)
{
POINT point; if (wParam == TASKICONNOTIFYID)
{
switch(lParam)
{
case WM_RBUTTONUP:
::GetCursorPos(&point);
::SetForegroundWindow(GetSafeHwnd());
//状態設定
popupMenu->EnableMenuItem(ID_CONNECT, commo.isconnect() ? MF_GRAYED : MF_ENABLED);
http://www.vckbase.com/document/viewdoc/?id=1448
popupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, point.x, point.y, this);