|
-
Aug 14th, 2001, 06:13 PM
#1
Thread Starter
Lively Member
Popup Menu
I'm working on a shell replacement.... Instead of a start menu, im wanting to make it so you right click on the desktop and it pops up a menu. I tried to do it from a resource, but I gave up on that. How do I do this? Same type of thing as a systray icon.
-
Aug 14th, 2001, 08:23 PM
#2
Monday Morning Lunatic
Code:
HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(MNU_MAIN));
if(!hMenu || !IsMenu(hMenu) || !pOwner || !IsWindow(pOwner->m_hWnd)) return -1;
POINT thePoint;
GetCursorPos(&thePoint);
SetForegroundWindow(hWndParent);
int iID = TrackPopupMenu(GetSubMenu(hMenu, 0), TPM_RIGHTALIGN | TPM_RETURNCMD, thePoint.x, thePoint.y, 0, pOwner->m_hWnd, NULL);
DestroyMenu(hMenu);
The highlighted line is important for tray icons, not sure about when randomly popping things up.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2001, 08:24 PM
#3
Monday Morning Lunatic
Oh yeah, it has to be a submenu off a menu, not on the root.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 15th, 2001, 05:53 PM
#4
Thread Starter
Lively Member
So how would this menu be layed out? (API or Diagram)
-
Aug 16th, 2001, 08:30 AM
#5
Monday Morning Lunatic
This is what it should look like.
GetSubMenu(hMenu, 0) gets the first submenu (the opened one) and uses that.
PS: You might need to save this and open it separately if it doesn't work because something's up with the server's MIME types.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|