Prevent Application from Getting Focus

hercemer

Newcomer
Joined
Apr 21, 2003
Messages
11
I am writing a virtual keyboard as on overlay for 3rd party apps. I am trying to find a way to keep the .NET keyboard from ever taking the focus from the 3rd part app (started by the .NET App) to prevent the title bar flickering etc...

I have tried this link
http://www.xtremedotnettalk.com/showthread.php?t=81013&highlight=prevent+focus
But it appears to be for 2 windows in the same .NET app, not 1 .NET app and other programs.

I am using VB.NET and sendkeys/sendmessage (depending on the user options).

Thanks in advance!
 
Found the solution

For anyone interested...

Private Const WS_EX_NOACTIVATE = &H8000000

Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or WS_EX_NOACTIVATE
Return cp
End Get
End Property

hercemer said:
I am writing a virtual keyboard as on overlay for 3rd party apps. I am trying to find a way to keep the .NET keyboard from ever taking the focus from the 3rd part app (started by the .NET App) to prevent the title bar flickering etc...

I have tried this link
http://www.xtremedotnettalk.com/showthread.php?t=81013&highlight=prevent+focus
But it appears to be for 2 windows in the same .NET app, not 1 .NET app and other programs.

I am using VB.NET and sendkeys/sendmessage (depending on the user options).

Thanks in advance!
 
Back
Top