Is there any way I can achieve something faster? either through some event mechanism or by any other means?
I would like something similar to that of a win32 application, as shown below.
int Application::run(){ while(msg.message != WM_QUIT) { if(PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) // If there are Window messages then process them. { TranslateMessage( &msg ); DispatchMessage( &msg ); } else // Otherwise, do my work { } return (int)msg.wParam;}
I assume this is how WPF is doing it in the background with its Application.Run(Window()) method. Is there anyway of getting some kind of callback on that "else" branch?