Results 1 to 14 of 14

Thread: A bit of Help please (solved)

Threaded View

  1. #7

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Ohio
    Posts
    44
    Mc Brain What is your code supposed to do ?


    The Window i'm trying to get the handle for is one for another
    program.


    in the form i have this
    VB Code:
    1. Private Sub Form_Load()
    2. EnumWindows AddressOf EnumWindowsProc, 0
    3. End Sub

    In a Module i have this

    VB Code:
    1. Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
    2.     Dim Length As Long
    3.     Dim sName As String
    4.     Length = GetWindowTextLength(hwnd) + 1
    5.    
    6.     If Length > 1 Then
    7.       sName = Space(Length)
    8.       GetWindowText hwnd, sName, Length
    9.       sName = Left$(sName, Length - 1)
    10.       'Use the Like operator to search with wildcards
    11.       If sName Like "*The Wizard: Current Macro Set:*" Then
    12.            MsgBox "The handle is: " & sName
    13.      DRhwnd = hwnd
    14.      MsgBox DRhwnd
    15.       End If
    16.     End If
    17.  
    18.     EnumWindowsProc = 1
    19. End Function


    If i try and put a message box in my form an have it display the
    handle of the window it just shows up blank, that is my main
    problem i can't seem to access the information in the Enumwindows function
    Last edited by Irre; Dec 6th, 2001 at 07:32 AM.

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