I just wanted to know whether anyone could explain to me [I]exactly[I] how to access the properties of other windows of the desktop that are not of my application. I'd like to do things like, say, find their position, find wether or not they are minimised or maximised, where, access the text on controls placed on them,...
Also, how would I use the hWnd property of another window (not of my application) to make an object our of that window which I could use to access it's properties in an easier way, if at all possible.
What is messaging? How can I use it, and what is it for?
Isn't there a nice class I could get from somewhere that encapsulates all the dirty work and provides a humanisitic collection of all windows on the screen just like, for example, the controls collection of a VB form? I'd appreciate anyone's help.
Isn't there a nice class I could get from somewhere that encapsulates all the dirty work and provides a humanisitic collection of all windows on the screen just like, for example, the controls collection of a VB form?
Not that I know of, but it's a great idea. I might write one
Ah yes, the good ole EventVB.dll - I remember it well.
Are you working on a .NET version?
Not as such - the .Net framework does pretty much everything that EventVB did (well, with the exception of printer monitoring ;-) ) so I'm just doing whichever bits aren't covered by the framework (gradually)
For this question I thing the eventvb ApiSystem class's .TopLevelWindows property which is a collection of ApiWindow classes and you could drill down through the ApiWindow's .ChildWindows property to build up a tree of all the windows open on an operating system...
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:
Dim objWindows As CWindows
Set objWindows = New CWindows
objWindows.GetWindows
Dim i As Long
For i = 1 To objWindows.Count
With objWindows(i)
' do something
End With
Next i
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.
If you feel this is in a finished state, put it in the CodeBank with a little Intro regarding what its purpose is, what it does, and briefly, how it does it.