-
Hello again all!
Im having trouble finding the a window in WINDOWS98. I'm using VB5
Here's my problam>
There is a window called "AwtWindow" and it has no text. Let's call this window 1
There is another window called "AwtWindow" and it has no text. Let's call this window 2
Window 1 and Window 2 are diffrent programs.
When I try and find Window2, it finds window 1 first.
I closed window 1 and window 2 is found. But both windows(1 and 2) need to be open for it to work.
How do I find window 2 by skipping around window 1?
Get it??? LoL
Thanks
-
I have a lot of API code that may help you.
Send me your current email address and I will forward the code.
Jon
-
It is very easy to find all windows with the same class name (or Caption) using FindWindowEx API. Here is an example:
Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
'------Put this on any event
Dim lWindow As Long
Dim iCount As Integer
lWindow = FindWindowEx(0, 0, "AwtWindow", vbNullString)
If lWindow Then
Do While lWindow
iCount = iCount + 1
lWindow = FindWindowEx(0, lWindow, "AwtWindow", vbNullString)
Loop
End If
MsgBox iCount & " windows found."
Assuming that AwtWindow is a class name.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819