The onscreen keyboard in Windows 7 will let you keep focus on a textbox while you type using the keyboard. In C# and .Net, how can I force another application to retain focus while accepting input just like the Win7 onscreen keyboard? Or perhaps a better way to word it, how can I not have my app take focus when interacted with?
I have tried LockSetForegroundWindow and have seen no results with it.
You have to set the
WS_EX_NOACTIVATEextended style on your window. The easiest way is by using P/Invoke.You can also use WPF interop class
HwndSourceto create your window. Its constructor accepts the extended window style.