|
-
Jun 5th, 2000, 01:16 AM
#1
Thread Starter
Member
Okay this may seem normal to other people but from the sound of it the GetActiveWindow api sounds as if it would return the hWnd os the active window??? Well it doesnt seem to work, so does anyone know how to get the hWnd of the active one???
Thanx
Cease
-
Jun 5th, 2000, 01:31 AM
#2
Fanatic Member
Code:
Declare Function GetActiveWindow Lib "user32" () As Long
Sub Main()
Dim lng_Return as Long
lng_Return = GetActiveWindow()
End Sub
Chemically Formulated As:
Dr. Nitro
-
Jun 5th, 2000, 01:44 AM
#3
Thread Starter
Member
Yer, i tried that
Yer thanx for the example, it woz slightly different to how i did it in my project, but that doesnt work either, that returns the hWnd if the form it is triggered from is active, but if you have sya IE active it returns 0??? Any further help would be great!
Thanx
Cease
-
Jun 5th, 2000, 02:34 AM
#4
Try GetForeGroundWindow:
Public Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Long
-
Jun 5th, 2000, 02:44 AM
#5
Lively Member
GetActiveWindow
The GetActiveWindow function retrieves the window handle to the active window attached to the calling thread's message queue.
HWND GetActiveWindow(VOID);
Parameters
This function has no parameters.
Return Values
The return value is the handle to the active window attached to the calling thread's message queue. Otherwise, the return value is NULL.
Remarks
To get the handle to the foreground window, you can use GetForegroundWindow.
- Steve
Real programmers use COPY CON PROGRAM.EXE
-
Jun 5th, 2000, 02:51 AM
#6
Thread Starter
Member
I see
okay thanx for all your help, esp for the explanation for why it was goin wrong,
Thanx
Cease
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|