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:
Private Sub Form_Load() EnumWindows AddressOf EnumWindowsProc, 0 End Sub
In a Module i have this
VB Code:
Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long Dim Length As Long Dim sName As String Length = GetWindowTextLength(hwnd) + 1 If Length > 1 Then sName = Space(Length) GetWindowText hwnd, sName, Length sName = Left$(sName, Length - 1) 'Use the Like operator to search with wildcards If sName Like "*The Wizard: Current Macro Set:*" Then MsgBox "The handle is: " & sName DRhwnd = hwnd MsgBox DRhwnd End If End If EnumWindowsProc = 1 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




Reply With Quote