Link to home
Start Free TrialLog in
Avatar of saulite
saulite

asked on

Enter key emulation trough Windows messages

I need to know, how i can send 'ENTER' key signal using windows messages (WM_KEYDOWN/WM_KEYUP or WM_CHAR).

Wich message(s) should i use?
What must be in wParam and what in lParam?

That's all. A very simple queston.
Avatar of The Master
The Master

It's not entirely clear what you're looking for.  Do you want to send this to an edit control, a dialog box, a button?  It kind of depends on what you're trying to do.  For example, to generate an enter in a multi-line edit control, I'm sure you could get away with sending a WM_CHAR.  But to close a dialog with the default button, WM_COMMAND might be a better choice.

However, check out the keybd_event() function - or the SendInput() function if you're only coding for Win2000/NT.  Are you looking for something like that by any chance?

Good luck!
Avatar of saulite

ASKER

i need to send message to ANOTHER program. If i'd need to send to my program, i'd used keybd_event.

can i send VK_RETURN using WM_CHAR? if yes, then how, if not - how i can do this  using WM_KEYDOWN combining with WM_KEYUP.
ASKER CERTIFIED SOLUTION
Avatar of The Master
The Master

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial