Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us 
|
How to open a menu-item from your application
This article has not been rated yet. After reading, feel free to leave comments and rate it.
You can do this by sending keystrokes to your application using keybd_event.
E.g. to open the "File" menu, you need to send "Alt-F":
 | |  | |
keybd_event(VK_MENU, MapVirtualkey(VK_MENU, 0 ), 0, 0);
keybd_event(Ord('F'), MapVirtualKey(Ord('F'), 0), 0, 0);
keybd_event(Ord('F'), MapVirtualKey(Ord('F'), 0), KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU, MapVirtualkey(VK_MENU, 0 ), KEYEVENTF_KEYUP, 0);
| |  | |  |
Comments:
|