Comment by electroly
3 years ago
You can use the "AddressOf" operator to get a function pointer, but it can only be used to pass to native (Win32) functions. This is how you do things like implementing your own WndProc function. VB itself can't call through the resulting function pointer.
The trick was to use some Win32 API function that is guaranteed to invoke the callback right away with the arguments that you specify explicitly. CallWindowProc was the usual go-to for that.