Groups | Blog | Home
all groups > dotnet interop > december 2007 >

dotnet interop : EnumWindows, VB.Net


Zamdrist
12/19/2007 1:35:50 PM
I know that a callback function can be used to run the EnumWindows
function of WIn32 API in VB.Net.

My question is however...is there a strictly VB.Net way of doing this,
not using a callback function and the Win32 API?

i.e. What is the .Net *way*...or is there one?

Mattias Sjögren
12/20/2007 7:06:01 AM
[quoted text, click to view]

No there isn't.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Kerem Gümrükcü
12/20/2007 10:36:12 AM
Hi,

there is no real .NET way, but you can enumerate
all processes and try to get their Main Window Handles
and Window Captions by using this:

For Each p As Process In Process.GetProcesses()

Debug.WriteLine("Window Handle: " + p.MainWindowHandle.ToString() + " -
Window Title: " + p.MainWindowTitle)

Next p

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

AddThis Social Bookmark Button