Results 1 to 2 of 2

Thread: Findong if a winow is open

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Scotland, UK
    Posts
    321

    Question Findong if a winow is open

    Hi, basically, I need to know, how I can check if a window is open, and if it is do something.

    The window is in another program

  2. #2
    Megatron
    Guest
    Use the FindWindowEx function.
    VB Code:
    1. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    2.  
    3. Private Sub Command1_Click()
    4.     Dim hApp as Long
    5.     hApp = FindWindowEx(0, 0, "ClassName", "WindowName")
    6.     If hApp <> 0 Then MsgBox "Window is open
    7. End Sub

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