64,654
社区成员
发帖
与我相关
我的任务
分享
if (m_Menu == NULL)
{
m_Menu.CreatePopupMenu();
}
else
{
int nItemCount = m_Menu.GetMenuItemCount();
for (int i =0;i < nItemCount;i++)
{
m_Menu.DeleteMenu(0,MF_BYPOSITION);
}
}
int sss = m_Menu.GetMenuItemCount();
thWnd = GetSafeHwnd();
EnumWindows(EnumWindowsProc,NULL);
CPoint pt;
GetCursorPos(&pt);
m_Menu.TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this);
m_Menu.DestroyMenu();
HWND phWnd = NULL;
phWnd = GetParent(hwnd);
if (phWnd == NULL && IsWindowVisible(hwnd) == 1&&thWnd != hwnd)
{
char str[MAX_PATH];
GetWindowText(hwnd,str,MAX_PATH);
if (strlen(str))
{
m_Menu.AppendMenuA(MF_STRING,(UINT)m_Menu.m_hMenu,str);
}
}
return TRUE;