Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File exists Pin
David Crow23-Dec-03 10:05
David Crow23-Dec-03 10:05 
GeneralGetting the Image of a WIndow Pin
vladimir_india23-Dec-03 6:27
vladimir_india23-Dec-03 6:27 
GeneralRe: Getting the Image of a WIndow Pin
l a u r e n23-Dec-03 7:13
l a u r e n23-Dec-03 7:13 
GeneralRe: Getting the Image of a WIndow Pin
vladimir_india23-Dec-03 20:52
vladimir_india23-Dec-03 20:52 
GeneralRe: Getting the Image of a WIndow Pin
Robert Kuster23-Dec-03 10:28
Robert Kuster23-Dec-03 10:28 
GeneralRe: Getting the Image of a WIndow Pin
vladimir_india23-Dec-03 21:05
vladimir_india23-Dec-03 21:05 
GeneralUrgent Help Needed Pin
Binayak23-Dec-03 6:12
Binayak23-Dec-03 6:12 
GeneralRe: Urgent Help Needed Pin
Jörgen Sigvardsson23-Dec-03 7:23
Jörgen Sigvardsson23-Dec-03 7:23 
Basically, you need to create a menu in the resource entry. Create a new menubar, but don't add the menubar to your frame window.

Now make a submenu and add your menu items. Make sure the "Open With" entry has the same ID as "Menu File | Open". This will reuse your already existing code to open an XML document since it will call the event handler you already have in your message map.

In your application you need to trap the right click event, i.e. WM_RBUTTONDOWN. Then fire up the submenu using this (pseudo)code:
HMENU hMenuBar = ::LoadMenu(hInstance, ID_OF_YOUR_NEWLY_CREATED_MENUBAR);
HMENU hSubMenu = ::GetSubMenu(hMenuBar, 0); // Assuming your submenu is the first menu on the menu bar
TrackPopupMenuEx(hSubMenu, TPM_SEE_MSDN_DOCS, x_coord, y_coord, 0, m_hWndOfEventReceiveingWindow, NULL);


Since you didn't specify what toolkit you are using, I used the Win32 API. If you are using MFC or ATL/WTL, you can easily find the corresponding functions since they more or less map 1:1

--
Sancte Míchael Archángele, defénde nos in proélio contra nequítiam et
insídias diáboli esto præsídium. Imperet illi Deus, súpplices deprecámur:
tuque, princeps milítiæ cæléstis, Sátanam aliósque spíritus malígnos, qui
ad perditiónem animárum pervagántur in mundo, divína virtúte,
In inférnum detrude. Amen.

GeneralRe: Urgent Help Needed Pin
Binayak23-Dec-03 7:34
Binayak23-Dec-03 7:34 
GeneralRe: Urgent Help Needed Pin
Jörgen Sigvardsson23-Dec-03 7:38
Jörgen Sigvardsson23-Dec-03 7:38 
GeneralRe: Urgent Help Needed Pin
WoutL23-Dec-03 22:26
WoutL23-Dec-03 22:26 
Generallong!=long? //RECT problem Pin
IndrekSnt23-Dec-03 5:09
IndrekSnt23-Dec-03 5:09 
GeneralRe: long!=long? //RECT problem Pin
Dominik Reichl23-Dec-03 5:20
Dominik Reichl23-Dec-03 5:20 
GeneralRe: long!=long? //RECT problem Pin
IndrekSnt23-Dec-03 5:26
IndrekSnt23-Dec-03 5:26 
GeneralRe: long!=long? //RECT problem Pin
Jörgen Sigvardsson23-Dec-03 7:12
Jörgen Sigvardsson23-Dec-03 7:12 
GeneralRe: long!=long? //RECT problem Pin
WoutL24-Dec-03 2:16
WoutL24-Dec-03 2:16 
QuestionHow detect of USB Web-Came connect on PC Pin
Vladimir Konychev23-Dec-03 4:45
Vladimir Konychev23-Dec-03 4:45 
Questionhow do I use slider control in VC6? Pin
gamerPotatoe23-Dec-03 3:37
gamerPotatoe23-Dec-03 3:37 
AnswerRe: how do I use slider control in VC6? Pin
David Crow23-Dec-03 4:24
David Crow23-Dec-03 4:24 
GeneralConvert an int to char array rep Pin
Anonymous23-Dec-03 2:58
Anonymous23-Dec-03 2:58 
GeneralRe: Convert an int to char array rep Pin
Ian Darling23-Dec-03 3:28
Ian Darling23-Dec-03 3:28 
GeneralRe: Convert an int to char array rep Pin
Anonymous23-Dec-03 4:21
Anonymous23-Dec-03 4:21 
GeneralRe: Convert an int to char array rep Pin
nde_plume23-Dec-03 4:19
nde_plume23-Dec-03 4:19 
GeneralRe: Convert an int to char array rep Pin
Anonymous23-Dec-03 4:25
Anonymous23-Dec-03 4:25 
GeneralRe: Convert an int to char array rep Pin
nde_plume23-Dec-03 9:08
nde_plume23-Dec-03 9:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.