1. [Win32Lib] simulating a keypress?
- Posted by DanM Mar 11, 2009
- 829 views
How can I simulate a keypress in my program?
I suspect "SendMessage" is the way to go, but I don't know how to use it.
I want to make an edit box that comes to expect an <enter> keypress think <enter> has been pressed.
Dan
2. Re: [Win32Lib] simulating a keypress?
- Posted by DanM Mar 11, 2009
- 847 views
I mis-spoke slightly, it's not an editBox that's expecting a <return>, but rather the edit aspect of a TreeView control.
Doesn't make any difference, I think?
Dan
3. Re: [Win32Lib] simulating a keypress?
- Posted by CChris Mar 11, 2009
- 873 views
I mis-spoke slightly, it's not an editBox that's expecting a <return>, but rather the edit aspect of a TreeView control.
Doesn't make any difference, I think?
Dan
w32VOID = invokeHandler(the_control, w32HKeyDown,{VK_ENTER,0})
Sending the raw message will lead you there anyway.
CChris
4. Re: [Win32Lib] simulating a keypress?
- Posted by DanM Mar 11, 2009
- 871 views
I mis-spoke slightly, it's not an editBox that's expecting a <return>, but rather the edit aspect of a TreeView control.
Doesn't make any difference, I think?
Dan
w32VOID = invokeHandler(the_control, w32HKeyDown,{VK_ENTER,0})
Sending the raw message will lead you there anyway.
CChris
Thanks Chris,
Maybe because of what I'm already doing in the w32KeyDown handler, that didn't work, but simply setFocus(anotherWindow) DID work.
I chanced on that when I happened to click on another window while the TV was waiting for <return>, and when I came back to the TV, it had responded as if I'd hit <return>.
Dan