Advertisement
Advertisement
| 02.27.2008 at 10:07AM PST, ID: 23197818 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: |
Function EnumWinProc(ByVal hwnd As Integer, ByVal lParam As Integer) As Integer Dim k As Integer Dim sName As String If GetParent(hwnd) = 0 Then 'If IsWindowVisible(hwnd) And GetParent(hwnd) = 0 Then sName = Space(128) k = GetWindowText(hwnd, sName, 128) If k > 0 Then sName = Left(sName, k) If lParam = 0 Then sName = UCase(sName) If Trim(sName) = Trim(sPattern) Then hFind = hwnd EnumWinProc = 0 Exit Function End If End If End If EnumWinProc = 1 End Function Public Function FindWindowWild(ByRef sWild As String, Optional ByRef bMatchCase As Boolean = True) As Integer sPattern = sWild If Not bMatchCase Then sPattern = UCase(sPattern) 'UPGRADE_WARNING: Add a delegate for AddressOf EnumWinProc Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="E9E157F7-EF0C-4016-87B7-7D7FBBC6EE08"' EnumWindows(AddressOf EnumWinProc, bMatchCase) FindWindowWild = hFind End Function |