Results 1 to 2 of 2

Thread: finding a window

  1. #1

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    finding a window

    How do get the hwnd of a window like notepad, internet explorer (even if the programs are not running)

    Actually, I want to change the menu of ie. So I need the hwnd of ie even if it is running at that time or not.
    Baaaaaaaaah

  2. #2
    Matthew Gates
    Guest
    Use the FindWindow API function.


    VB Code:
    1. Private Declare Function FindWindow Lib "user32" _
    2. Alias "FindWindowA" (ByVal lpClassName As String, ByVal _
    3. lpWindowName As String) As Long
    4.  
    5. Private Sub Command1_Click()
    6.  
    7.     Dim hWin As Long
    8.     hWin = FindWindow("IEFrame", vbNullString)
    9.     If hWin <> 0 Then
    10.         Msgbox "Window hwnd: " & hWin
    11.     Else
    12.         Msgbox "Window hwnd: " & hWin '0
    13.      End If
    14.    
    15. 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