Results 1 to 6 of 6

Thread: Errr.... GetActiveWindow

  1. #1

    Thread Starter
    Member
    Join Date
    May 2000
    Posts
    43

    Question

    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

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    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

  3. #3

    Thread Starter
    Member
    Join Date
    May 2000
    Posts
    43

    Angry 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

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Try GetForeGroundWindow:
    Public Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Long

  5. #5
    Lively Member
    Join Date
    Apr 2000
    Location
    Hell
    Posts
    89
    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

  6. #6

    Thread Starter
    Member
    Join Date
    May 2000
    Posts
    43

    Talking 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
  •  



Click Here to Expand Forum to Full Width