|
-
Nov 30th, 2001, 11:30 PM
#1
Thread Starter
Hyperactive Member
MenU need to help me(these puns are just getting bad...)
I am attempting to simulate accessing a menu bar option in a macro. I believe I am close. First I am getting the menu handle with getmenu(applicationhandle). Next, I am using getmenuitemid(menuhandle, index). Then I believe I am supposed to use sendmessage(menuhandle, wm_command, wparam, lparam) where lparam is 0 and the lower half of wparam is the menuid; first of all, will this work? Secondly how do I make a wparam so that the lower half is the id? Thank you for your help.
Joe
-
Dec 1st, 2001, 11:08 AM
#2
Lively Member
Well, if this post is related to "Complex Menu Question" earlier, then you won't get the menu item that you're looking for. Instead, you'll get the menu category several places over from what you're looking for, or an error (unless I'm a total loser and am completely wrong about this).
Menuhandle = GetMenu(apphandle) returns the handle to the menubar itself. Setting Itemhandle = GetMenuItemID(Menuhandle, 3) will either generate an error, or return the fourth top-level menu on the menubar. First, you need to get the submenu that the item you wants resides in.
SMenuhandle = GetSubMenu(Menuhandle, 0) would return the handle to the first submenu in the menubar. Then calling Itemhandle = GetMenuItemID(SMenuhandle, index) should return the item in the submenu that you're looking for.
I can't really help you with the SendMessage part, cuz I'm still figuring out the down and dirty of it myself. Hope this helps!
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
|