PDA

Click to See Complete Forum and Search --> : Simulating Menu Execution


Joey_k29
Dec 4th, 2001, 11:39 AM
I am creating a macro program in order to automate the setup of lotus notes. I am using spy++ to obtain the handles of the objects and executing code accordingly. I am encountering one major problem. I need to access the menu commands without using a method such as send keys. I was told that I can use wm_command in conjunction with sendmessage in order to invoke the same code that is used when the user selects it normally. How would I say do this for File New(ordinal position 1). I was given the code sendmessage(hwnd, wm_command, makewparam((MENUID, 0),0), 0&). First of all, does vb even support a makewparam? If not, is there away around it. Secondly, MenuID is what? I obviously must use GetMenuItemID API call but do I main = GetMenu(hwnd), newcommand = GetSubMenu(main, 0) (The logic being that new is the first or 0th ordinal postiion), and then MENUID = GetMenuItemID(newcommand, 0)??? Or do I I simply GetMenuItemID(main, 0)?? I would appreciate any help. Thank you very much.
Joe