Click to See Complete Forum and Search --> : How to know if my App have focus in taskbar


Laurent VOISIN
October 15th, 2001, 08:01 AM
Hi,

I would like to know if my application have focus in taskbar ?

Thanks in advance,
Laurent.

Clearcode
October 15th, 2001, 11:00 AM
You can use the GetForegroundWindow API.


'\\ Declaration
Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () as Long




use:

'\\ in app main form....
If GetForegroundWindow() = me.hWnd then
MsgBox "I have the focus!!"
End If




HTH,
D.

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.