|
-
February 9th, 2007, 11:52 AM
#1
How do I count the number of open window using VB?
I've written a program, and part of it needs to cycle through every open window on my PC (doing a Alt+tab sendkey) only once. Anyhow, I need to know how I can get a count of the number of open windows on my PC, so I can use that as a comparison value in a FOR statement. Is there a function that returns this value? Thanks,
Joe
....
Private Sub Command1_Click()
dim windowCount as integer
dim i as integer
windowCount = <function that returns number of open windows>
For i = 0 To windowCount
... do stuff...
Next
End Sub
....
I'm using Visual Basic - Microsoft Visual Studio 6.0
Last edited by jcacka; February 9th, 2007 at 12:08 PM.
-
February 10th, 2007, 01:03 PM
#2
Re: Counting the number of open window using VB.
It's much easier to use:
Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|