April 2008
Intermediate to advanced
704 pages
17h 49m
English
Problem
You need to call an asynchronous unmanaged function, such as EnumWindows, and allow it to call a method, or make a callback, in your code.
Solution
Create a delegate that has the required signature for the callback. Use this delegate when defining and using the unmanaged function.
How It Works
Many of the Win32 API functions use callbacks. For example, if you want to retrieve the name of all the top-level windows that are currently open, you can call the unmanaged EnumWindows function in the User32.dll file. When calling EnumWindows, you need to supply a pointer to a function in your code. The Windows operating system will then call this function repeatedly, once for each top-level ...
Read now
Unlock full access