Ok I got it to work now (it works for now on) but I just wanted to know if it really is fine, here is my code:
PHP Code:
#include <windows.h>
using namespace std;
DEVMODE ScreenSettings;
HWND GameWindow, ExtraWindow;
int main()
{
Sleep ( 20000 );
if ( ! ( GameWindow = FindWindow ( 0, "Jedi KnightŪ: Jedi Academy (MP)" ) ) )
{
MessageBox ( 0, "Could not find the \"Jedi Academy\" window!", "Error", MB_OK | MB_ICONERROR );
exit ( 0 );
}
EnumDisplaySettings ( NULL ,ENUM_CURRENT_SETTINGS, & ScreenSettings );
ExtraWindow = FindWindow ( 0, "Movie Battles II" );
ShowWindow ( ExtraWindow, SW_HIDE );
ShowWindow ( GameWindow, SW_FORCEMINIMIZE );
ChangeDisplaySettings ( 0, 0 );
Sleep ( 5000 );
ShowWindow ( GameWindow, SW_RESTORE );
ChangeDisplaySettings ( & ScreenSettings, CDS_RESET );
}
Thanks, Yuri.