Board index » delphi » Main menu item auto activation?

Main menu item auto activation?

Hi, there!
How to force main menu item to be active (get focus and pull down)
just when main form is created and shown on the screen?
Automatically by default, without human action (Alt+... or F10).
--
Oleg V. Chistyakov
--
 

Re:Main menu item auto activation?


Quote
> How to force main menu item to be active (get focus and pull down)
> just when main form is created and shown on the screen?
> Automatically by default, without human action (Alt+... or F10).

You have to fake keyboard action:

 keybd_event( VK_F10, MapVirtualkey( VK_F10, 0 ), 0, 0);
 keybd_event( VK_F10, MapVirtualkey( VK_F10, 0 ), KEYEVENTF_KEYUP, 0);
 keybd_event( VK_DOWN, MapVirtualKey( VK_DOWN,0), 0, 0);
 keybd_event( VK_DOWN, MapVirtualKey( VK_DOWN,0), KEYEVENTF_KEYUP, 0);

Use OnActivate or perhaps OnPaint (in the latter case the first
statement should be OnPaint := Nil to prevent the event from firing
more than once).

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:Main menu item auto activation?


Also TrackPopupMenu() function could be useful.

Sincerely, Andrew Cher,
AnimatedMenus.com, Inc.

-------------------------------------------------------
 AnimatedMenus/2000 is the only
 Office 2000 and Windows 2000 compatible
 menu system for Delphi and C++Builder
-------------------------------------------------------
 Visit us today on the World Wide Web at:
 http://www.animatedmenus.com/
-------------------------------------------------------

Oleg V. Chistyakov <ol...@sprynet.com> wrote in message
news:37D10984.B90F87B0@sprynet.com...

Quote
> Hi, there!
> How to force main menu item to be active (get focus and pull down)
> just when main form is created and shown on the screen?
> Automatically by default, without human action (Alt+... or F10).
> --
> Oleg V. Chistyakov
> --

Other Threads