Sign in to follow this  
Haytil

Running Programs on Second Monitor from MSVC

Recommended Posts

Hello, I recently got a large second monitor, which I connect to my laptop and extend my desktop onto. I would like to run programs from within Microsoft Visual C++ 2005 Express edition on the second monitor - to take advantage of the large size and to test larger resolutions. However, when I run a program from within MSVC, it automatically defaults to the smaller, laptop monitor. You might think a workaround would be to drag my programs from the main monitor to the second - but aside from being a hassle each time I want to run the program and test something, it also makes it impossible to start full-screen applications with a larger resolution than my laptop monitor (negating any advantage of the larger, second monitor). Is there a way to configure MSVC to run in the second monitor when available? Thanks.

Share this post


Link to post
Share on other sites
It's not MSVC that gets to choose which monitor your program starts on, it's your program. By default, when you call CreateWindow, if you use CW_USEDEFAULT for the x and y parameters, your window will open on the primary monitor.

It is common for programs, when they close, to "remember" their window position/size somehow (e.g. by saving it a file in %APPDIR% or putting it in the registry, etc). Then, when they start up again, they read that file back in and start at the same position again.

Share this post


Link to post
Share on other sites

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