Right click on listview item display context menu
-
Hi I have a listview control, created with single selection, the list contains the names of printers, port names etc. When I right click an item how can I display the context menu that is displayed when you right click a printer object in Printers and Faxes ? i.e the user sees the same menu to be able to delete/rename printer, click the properties item etc. I'm using Visual C++ 6.0 on Windows XP, and know how to obtain a handle and open the printer in question and use the PrinterProperties call, but I want to display the menu as you can in Printers and Faxes. Thanks in advance
-
Hi I have a listview control, created with single selection, the list contains the names of printers, port names etc. When I right click an item how can I display the context menu that is displayed when you right click a printer object in Printers and Faxes ? i.e the user sees the same menu to be able to delete/rename printer, click the properties item etc. I'm using Visual C++ 6.0 on Windows XP, and know how to obtain a handle and open the printer in question and use the PrinterProperties call, but I want to display the menu as you can in Printers and Faxes. Thanks in advance
Hi pgibson007700 , Can you see to view context_menu in the right click?
-
Hi pgibson007700 , Can you see to view context_menu in the right click?
I have not written any code yet to process the right click, all I want to do is what Printers and faxes does i.e displays menu with Open, Printing Preferences..., Properties etc, remember my list control with only contain a text item, which is the name of the printer. Therefore I can obtain server name etc and use OpenPrinter to obtain a handle etc.
-
I have not written any code yet to process the right click, all I want to do is what Printers and faxes does i.e displays menu with Open, Printing Preferences..., Properties etc, remember my list control with only contain a text item, which is the name of the printer. Therefore I can obtain server name etc and use OpenPrinter to obtain a handle etc.
if you want to view Context_menu in the right click CMenu menu; menu.LoadMenu(IDR_MAINFRAME); CMenu *pContextMenu=menu.GetSubMenu(0); BOOL o=pContextMenu->InsertMenu(0, MF_BYPOSITION | MF_STRING | MF_DISABLED, 0, "StL OBJECT"); pContextMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,point.x,point.y,AfxGetMainWnd()); /*{ CPoint point; GetCursorPos(&point); }*/ this section BOOL o=pContextMenu->InsertMenu(0, MF_BYPOSITION | MF_STRING | MF_DISABLED, 0, _T("or anything")); I reply to question and this is here it can to delete -- modified at 13:22 Sunday 12th March, 2006