You can't fix it:
A classic Windows message loop with DirectX included looks like this:
INT WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow )
{
MSG msg;
while ( 1 )
{
// Only render when there are no messages
if ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
if ( msg.message == WM_QUIT )
break;
TranslateMessage( &msg );
DispatchMessage ( &msg );
}
else
{
render_here();
}
}
// Give back resources
SAFE_RELEASE( pD3DDevice );
SAFE_RELEASE( pD3D9 );
return 0;
}
This is similar if not the same to how DarkGDK handles windows messages.
Your_Health = (My_Mood == HAPPY) ? 100 : NULL;