Sign in to follow this  

Pause full screen application

This topic is 3099 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, If any fullScreen application is running i want to pause/minimize it and open my fullscreen application.After that i want to restore again the initial application. C++ code will be appreciable. Thanks, Gerald.

Share this post


Link to post
Share on other sites
Well in my custom C++ game API, all you gotz to do is this:

//Somewherez in code
Game.setMode ( Game::GOD_MODE )



and everything is *fabulous*.

Joking aside, you have to tell us what API or engine you are using or what platform you are making this on. We don't have mind powers.

Share this post


Link to post
Share on other sites
I think i should be more clear with my question

I have an Console application(Say A.exe) built in VC++,the job of this application is to find any game is currently running in my pc.
If game is running the A.exe will call another exe say (B.exe).

The problem is "B.exe" should open in full screen mode and the game that was running previously should be paused/minimized.

I tried the following code which is in "A.exe" calls the "B.exe"

DWORD spi_time;
SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &spi_time, 0);
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, (LPVOID)0, 0);


STARTUPINFO info={sizeof(info)};
PROCESS_INFORMATION processInfo;
info.wShowWindow = SW_SHOW;

if (CreateProcess(NULL, "B.exe", NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo))
{
HWND hWnd = FindWindowA(NULL, "Quiz Application" ); //Window name of "B.exe"
SetForegroundWindow(hWnd);
SetActiveWindow(hWnd);

::WaitForSingleObject(processInfo.hProcess, INFINITE);
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
}

The above code opens the "B.exe" but not able to focus as the first visible application (ie) B.exe is not spawn over the game which is running.

Share this post


Link to post
Share on other sites

This topic is 3099 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this