Results 1 to 10 of 10

Thread: Window Manager Help

Hybrid View

  1. #1
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Window Manager Help

    If you want all the windows to be seperated by :: then you will need to dim w in the declarations, cause if its decalered inside the sub, eachtime w will be "" so it will erase the previous value so therefore

    VB Code:
    1. [B]Dim W As String[/B]
    2. Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal Lparam As Long) As Boolean
    3. Dim Strcaption As String, NSize As Long, i As Integer
    4. Dim astrDataItem() As String
    5.  
    6. NSize& = GetWindowTextLength(hwnd&)
    7. Strcaption$ = Space$(NSize& + 1)
    8.  
    9.     If IsWindowVisible(hwnd&) = 1 Then
    10.     Call GetWindowText(hwnd&, Strcaption$, Len(Strcaption$))
    11.    
    12.     If Strcaption$ <> Chr$(0) Then
    13.         W = W & "::" & Left$(Strcaption$, Len(Strcaption$) - 1)
    14.     End If
    15.  
    16. End If
    17.  
    18. astrDataItem() = Split(W, "::")
    19. For i = 0 To UBound(astrDataItem)
    20. Form1.List1.AddItem astrDataItem(i)
    21. Next
    22.  
    23. EnumWindowsProc = True
    24.  
    25. End Function
    Last edited by Andrew G; Feb 25th, 2006 at 10:28 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