Groups | Blog | Home
all groups > dotnet sdk > june 2005 >

dotnet sdk : Passing pointers in EnumWindows


Jim Brent
6/4/2005 12:59:10 PM
I know this must be easier than I am making it but...

The EnumWindows api call requires that a pointer to the function that will
handle the values returned be passed as the second paramater. The AddressOf
operator won't produce the required "long" datatype. How do I get the
correct pointer for my handling function to put into the call?

Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As
Long, ByVal lParam As Long) As Long

retval = EnumWindows((Pointer to EnumWinProc), 0)



--
Jim Brent
Jim Brent
6/13/2005 4:04:02 PM
Thanks, I eventually found the examples and was able to make it work.

[quoted text, click to view]
Mattias Sjögren
6/13/2005 10:06:08 PM
Jim,

[quoted text, click to view]

You make the parameter type a delegate with the correct signature. If
you seach the .NET framework SDK documentation for "EnumWindows"
you'll find and example.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button