Post Reply
Gene Angelo 2004-08-17 02:47
Hi,
I want to turn Windows extended desktop on/off programatically. I am using Windows XP Home and Visual C++.
Thank you
|
Christian Studer 2004-08-17 03:13
You can do this with the SecondaryDisable and SecondaryEnable methods of the IUltraMonSystem interface.
Usually you would also want to save and restore the positions of windows and desktop icons, here's some sample code which demonstrates this:
IUltraMonSystem* pSys = 0; CoCreateInstance(CLSID_UltraMonSystem, 0, CLSCTX_ALL, IID_IUltraMonSystem, reinterpret_cast(&pSys));
// disable secondary monitors pSys->SavePositions(POS_ALL); pSys->SecondaryDisable();
// enable secondary monitors pSys->SecondaryEnable(); pSys->RestorePositions(POS_ALL);
See the Programming Guide for C++ in the SDK documentation for more information on the required headers etc.
Christian Studer - www.realtimesoft.com
|
Post Reply
|