How do I imitate a WM_COMMAND

Started by
2 comments, last by fatherjohn666 21 years, 5 months ago
Im my open gl app, I press the ALT key to exit my rendering loop and have access to the MFC menu's, however in my app I want the user to press ALT key once, thus activating the menu (as you do in any normal windows app, press alt, immediately calls the file menu) how do I do this? I tried all sorts basically I am trying to send a second WM_COMMAND to my uMsg in the WndProc function without having to press the key for it, kind of like if the user hits a key, I want to activate the another keypress internally as if the user pressed it, as currently they press alt twice to get the menu activation....I want it to be only one key press.... I hope that made sense.... CHEERS ~~~~~~~~~~~~~~~~~~~~~~~~~ http://on.to/oni [edited by - fatherjohn666 on November 4, 2002 8:24:15 AM]
~~~~~~~~~~~~~~~~~~~~~~~~~http://on.to/oni
Advertisement
Why do they have to press twice?

Have you tried processing WM_KEYDOWN for VK_ALT and either throwing a menu command or just launching your own popup?

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
quote:

Have you tried processing WM_KEYDOWN for VK_ALT and either throwing a menu command or just launching your own popup?

-fel


Im using DX
In the situation im in , im asking HOW do I THROW the menu command, thats what I want to know.

how do I automatically throw the command, throw a fake one...how?


"...basically I am trying to send a second WM_COMMAND to my uMsg in the WndProc function without having to press the key for it, kind of like if the user hits a key, I want to activate the another keypress internally as if the user pressed it, as currently they press alt twice to get the menu activation....I want it to be only one key press...."



~~~~~~~~~~~~~~~~~~~~~~~~~http://on.to/oni
Have you looked at the SendMessage function?

SendMessage
The SendMessage function sends the specified message to a window or windows. The function calls the window procedure for the specified window and does not return until the window procedure has processed the message. The PostMessage function, in contrast, posts a message to a thread''s message queue and returns immediately.

LRESULT SendMessage(
HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);

Parameters
hWnd
Handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.
Msg
Specifies the message to be sent.
wParam
Specifies additional message-specific information.
lParam
Specifies additional message-specific information.

This topic is closed to new replies.

Advertisement