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)

Signature
Jim Brent
SaBre Document Systems LLC
Mattias Sjögren - 13 Jun 2005 21:06 GMT
Jim,
>How do I get the
>correct pointer for my handling function to put into the call?
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

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jim Brent - 14 Jun 2005 00:04 GMT
Thanks, I eventually found the examples and was able to make it work.
> I know this must be easier than I am making it but...
>
[quoted text clipped - 7 lines]
>
> retval = EnumWindows((Pointer to EnumWinProc), 0)