views:

297

answers:

2

Hi, I m developing applcaiton in VS2008 VC++.net

I want to move the application to secondary monitor.Not by clicking and dragging using mouse. Is there any function like MoveToMonitor by pressing the button or any shortcut keys. Then it should move to secondary monitor.

+1  A: 

You should be able to call GetMonitorInfo and move your window to with in that.

See here ' MFC Example Multiple monitor support with GetSystemMetrics EnumDisplayMonitors and GetMonitorInfo' for more info.

If you are on Window 7 then the moving windows between monitors is Windows-Arrow

Preet Sangha
Can you provide me any sample coding on that.
Anu
There is some sample code on that second link
Preet Sangha
By usins the MSDN sample code,the screen fits to center,its not move to second monitor.
Anu
+2  A: 

You use MoveWindow (or SetWindowPos, though you don't need the extra things it can do in this case) to move the Window to the part of the desktop shown on the monitor in question. You can find that with (among other possibilities) EnumDisplayMonitors, which will tell you the rectangle associated with each monitor.

Jerry Coffin