I am developing plugin dll for thirdparty application. I want to do simple animation from my plugin dll, only when there is not messages in the main application i.e when the application is idle. The standrad way of doing this is :
while ( bDoingBackgroundProcessing )
{
MSG msg;
while ( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
{
if ( !PumpMessage( ) )
{
bDoingBackgroundProcessing = FALSE;
::PostQuitMessage( );
break;
}
}
// here draw
DrawScene();
}
But since I want to do the drawing from dll plugin, I can not this, i.e I can not modify the host application main message loop.
I already tried to put nested message loop in my dll, and it works with some problems, like some messages from the main application are not processed at all.
Anyone have suggestion how to solve this ?