Page 1 of 1

Callback and GetMessage

Posted: Sat Apr 05, 2008 1:06 pm
by Susan20
The SetWindowCallback function is a comfortable way with regard to the treatment of events. But according to the WinApi the API functions GetMessage, TranslateMessage and DispatchMessage should also work. My problem is: These functions require only a pointer to the structure MSG. How do they know what procedure in my PB-code is responsible for the handling of events? Shouldn't there be a pointer to my callback procedure as it is the case when I use: SetWindowCallback(@MyCallbackProcedure)?

P.S.
SetWindowCallback, WaitWindowEvent, WindowEvent - these all work fine. I only want to get a deeper inside in WinAPI. That's why I did post this question.

Posted: Sat Apr 05, 2008 1:27 pm
by netmaestro
When you register your window class the lpfnWndProc member of your WNDCLASSEX structure is where you will store the pointer to your callback.

Posted: Sat Apr 05, 2008 1:28 pm
by Fluid Byte
My problem is: These functions require only a pointer to the structure MSG.
AFAIK you are not able to obtain this pointer as this would interfere with PB's internal event loop. It's the same problem with the IsDialogMessage_() command wich would enable keyboard navigation like in standard Windows dialogs but you would need the pointer to the MSG structure as well.