On-Screen keyboard: how is it done?

P

Polaris

Hi Experts:

I saw an PC without keyboard attached, it uses an on-screen keyboard
software program. When user clicks on a "key" (a button) on the program, the
program can find the currently active (focused) window application (for
example, notepad.exe) and input "typed" key into that active program; but
the keyboard program itself seems did not get activated while user click on
a button on it.

I could not figure out how it is accomplished? How does the keyboard program
avoid getting focus (active) even when user click on a "key" button of the
program? It must be able to do so in order to find the currently active
Windows program that user is working with (etc, a notepad.exe).

Thanks for your thoughts in advance.
Polaris
 
M

Marcin Hoppe

Polaris pisze:
Thanks for your thoughts in advance.

What I'd do if I were you and didn't want to buy an off-the-shelf
product (like itKeyboard from http://www.touch-soft.com/) would be to
download a trial version of an off-the-shelf product and use Spy++ to
look at messages that it sends and receives.

Best regards!
 
S

Scott Seligman

Polaris said:
I could not figure out how it is accomplished? How does the keyboard program
avoid getting focus (active) even when user click on a "key" button of the
program? It must be able to do so in order to find the currently active
Windows program that user is working with (etc, a notepad.exe).

The window has the WS_EX_NOACTIVATE extended window style set.
 
D

David Ching

Scott Seligman said:
The window has the WS_EX_NOACTIVATE extended window style set.

Very cool... I had not known about this style. Before Win2K, the way to do
it was to intercept WM_MOUSEACTIVATE and return MA_NOACTIVATE (or
MA_NOACTIVATEANDEAT).

-- David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top