LRESULT DesktopShellView::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) { switch(nmsg) { case WM_CONTEXTMENU: if (!DoContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam))) DoDesktopContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)); break; case PM_SET_ICON_ALGORITHM: _icon_algo = wparam; PositionIcons(); break; case PM_GET_ICON_ALGORITHM: return _icon_algo; case PM_DISPLAY_VERSION: return SendMessage(_hwndListView, nmsg, wparam, lparam); default: return super::WndProc(nmsg, wparam, lparam); } return 0; }
bool C4EditCursor::RightButtonUp(DWORD dwKeyState) { Target=NULL; DoContextMenu(dwKeyState); // Update UpdateStatusBar(); return true; }
void CScreenEditView::OnLButtonDblClk(UINT nFlags, CPoint point) { CPoint tempPoint; tempPoint = point; ClientToScreen(&tempPoint); DoContextMenu(tempPoint); }
void wxGenericHyperlinkCtrl::OnRightUp(wxMouseEvent& event) { if( GetWindowStyle() & wxHL_CONTEXTMENU ) if ( GetLabelRect().Contains(event.GetPosition()) ) DoContextMenu(wxPoint(event.m_x, event.m_y)); }
void CScreenEditView::OnContextMenu(CWnd* pWnd, CPoint point) { DoContextMenu(point); }
LRESULT CMyTreeView::OnNotifyReflect(WPARAM, LPARAM lParam) { LPNMHDR lpnmh = (LPNMHDR) lParam; switch (lpnmh->code) { case NM_RCLICK: { CPoint ptScreen; ::GetCursorPos(&ptScreen); DoContextMenu(ptScreen); } break; case TVN_GETDISPINFO: { LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)lParam; TreeItemData* pItem = (TreeItemData*)lpdi->item.lParam; //do we need to supply the text? if (lpdi->item.mask & TVIF_TEXT) { SHFILEINFO sfi = {0}; //get the display name of the item if (pItem->GetFullCpidl().SHGetFileInfo(0, sfi, SHGFI_PIDL | SHGFI_DISPLAYNAME)) ::lstrcpyn(lpdi->item.pszText, sfi.szDisplayName, lpdi->item.cchTextMax - 1); } //do we need to supply the unselected image? if (lpdi->item.mask & TVIF_IMAGE) { SHFILEINFO sfi = {0}; //get the unselected image for this item if (pItem->GetFullCpidl().SHGetFileInfo(0, sfi, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_LINKOVERLAY)) lpdi->item.iImage = sfi.iIcon; } //do we need to supply the selected image? if (lpdi->item.mask & TVIF_SELECTEDIMAGE) { SHFILEINFO sfi = {0}; //get the selected image for this item if (pItem->GetFullCpidl().SHGetFileInfo(0, sfi, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON)) lpdi->item.iSelectedImage = sfi.iIcon; } } break; case TVN_ITEMEXPANDING: { LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam; switch (pnmtv->action) { case TVE_EXPAND: { UINT ExpandedOnce = pnmtv->itemNew.state & TVIS_EXPANDEDONCE; if (!ExpandedOnce) GetChildItems(pnmtv->itemNew.hItem); } break; } } break; case TVN_SELCHANGED: { LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam; TreeItemData* pItem = (TreeItemData*)pnmtv->itemNew.lParam; CMyListView* LeftView = GetExplorerApp().GetMainFrame().GetListView(); LeftView->DisplayFolder(pItem->GetParentFolder(), pItem->GetFullCpidl(), pItem->GetRelCpidl()); } break; } // switch(lpnmh->code) return 0; }