Results 1 to 14 of 14

Thread: A bit of Help please (solved)

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Ohio
    Posts
    44

    A bit of Help please (solved)

    I'm trying to find the handle of a window but since it's class name changes everytime the window is opened i'm having some trouble.
    I've found a bit of code that allows me to use wildcards to find the handle but i can't seem to figure out how to call the handle from my form.
    Here is the bit of code i have in my module
    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.         End If
    14.     End If
    15.  
    16.     EnumWindowsProc = 1
    17. End Function

    The Message box i have in there is just for me to know if the function worked Properly, and this part does.
    Anyone have any suggestions.
    Last edited by Irre; Dec 6th, 2001 at 07:54 PM.

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