|
-
Dec 26th, 2000, 11:29 PM
#1
Help,
Could you please give me some peice of code that
will tell me all the windows opened at a certain
time
Thanks in advance,
-
Dec 27th, 2000, 03:05 AM
#2
PowerPoster
Have you tried "EnumWindows". It is used to enumerate all top level windows. I have never used it so I don't have the code, but I think it would be pretty easy.
-
Dec 27th, 2000, 07:22 AM
#3
could you tell me the enumwindows code
-
Dec 27th, 2000, 08:45 AM
#4
PowerPoster
Put this code in a form
Code:
Public Function ListWindows() As Long
Dim rc As Long
Dim lParam As Long
'We're not concerned with a custom message at this time
lParam = 0
'call the api
ListWindows = EnumWindows(AddressOf EnumWindowsProc, lParam)
End Function
Private Sub Command1_Click()
Call ListWindows
End Sub
Put this code in a standard basic module(not in form or in class module)
Code:
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Debug.Print hwnd
'while this value is true it will keep on searching for open windows till it reaches
'the last window
EnumWindowsProc = True
End Function
But this will return you a large number of handle's. If you need only those on the desktop, try "EnumDesktopWindows" instead.
-
Dec 27th, 2000, 09:30 AM
#5
Frenzied Member
Download my window class: http://www.geocities.com/despotez/WH/
it has an example to get all the open windows too.
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
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
|