Hi, I was reading a article on the internet where they mentioned callback function but didnīt explain it. What is a callback function???
Printable View
Hi, I was reading a article on the internet where they mentioned callback function but didnīt explain it. What is a callback function???
A callback is a pointer to a function that can be passed around and called when needed.
Funny... those I just call "pointer to func". A bit more self explaining :)
in windows programing (WIN32 API ect) a callback function is where you process messages sent by windows.
It is mainly a complex nested switch statement.
All init, close, mouse, keyboard and paint messages ect are sent to your application and then forked and sent to the dialog that generated them.
you can process the message or pass it back to windows for default processing.
this is the standard form
LRESULT CALLBACK MainCallback(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)