Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows and focus
Message
From
10/12/2002 05:13:35
 
 
To
29/11/2002 07:34:01
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00728144
Message ID:
00731269
Views:
12
This message has been marked as the solution to the initial question of the thread.
there is an API GetForegroundWindow() written for that,
for ex:
' Display the title bar text of the foreground window.
Dim hforewnd As Long  ' receives handle of foreground window
Dim slength As Long  ' length of foreground window's title bar text
Dim wintext As String  ' buffer for foreground window's title bar text
Dim retval As Long  ' return value

hforewnd = GetForegroundWindow()  ' determine the foreground window
slength = GetWindowTextLength(hforewnd) + 1  ' length of its title bar text
wintext = Space(slength)  ' make room in the buffer to receive the text
retval = GetWindowText(hforewnd, wintext, slength)  ' get title bar text
wintext = Left(wintext, slength - 1)  ' remove null character from end of string
Debug.Print "The window "; wintext; " is the foreground window."
Best Luck..
Nilesh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform