1. [Win32Lib] simulating a keypress?

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

new topic     » topic index » view message » categorize

2. Re: [Win32Lib] simulating a keypress?

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: [Win32Lib] simulating a keypress?

DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: [Win32Lib] simulating a keypress?

CChris said...
DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu