Results 1 to 11 of 11

Thread: Enumerating Windows

Threaded View

  1. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Enumerating Windows

    The number of times I crashed VB writing this...

    At present, I haven't found a way of getting For Each to work, so to to loop through all windows you have to do this:
    VB Code:
    1. Dim objWindows As CWindows
    2. Set objWindows = New CWindows
    3. objWindows.GetWindows
    4.  
    5. Dim i As Long
    6. For i = 1 To objWindows.Count
    7.     With objWindows(i)
    8.         ' do something
    9.     End With
    10. Next i
    11.  
    12. Set objWindows = Nothing

    It has 2 classes, CWindows (collection class) and CWindow (wraps various window-related APIs) and a .bas module MCallbacks.

    I'll update it with any feature requests, at the moment it just has the basics such as window caption, position, etc.

    Attached Files Attached Files

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