Results 1 to 3 of 3

Thread: Active Window

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284

    Post

    Someone out there please tell me how you can code a form so that it can tell if it is currently the active form.

    If you are going to suggest ZOrder or the VBE class please be specific as I have had no luck with either so far.

    Thanks

  2. #2
    New Member
    Join Date
    Feb 2000
    Posts
    8

    Post

    Might only need the GetForegroundWindow API.

    API:
    Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Long

    Code:
    If GetForegroundWindow = Me.hWnd Then
    'Your form has the focus
    Else
    'Your form doesn't have the focus
    End If

    Might be what you want, might not...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284

    Post

    Thanks KDivad that solved the problem

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