Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / June 2005

Tip: Looking for answers? Try searching our database.

Passing pointers in EnumWindows

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Brent - 04 Jun 2005 20:57 GMT
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)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.