//这是一个设置扩展桌面程序,原文在http://www.cnblogs.com/Impulse/archive/2009/4/10.html 结构很清晰。编译也没有问题。怎么调用让他起作用?大家可以试试用vs 2008 vc#
namespace screen
{#region code
Using …
namespace WindowsSreen
{ classMulScreen
{
public struct DISPLAY_DEVICE…
public struct DEVMODE…
public void Mul()
{ DISPLAY_DEVICEd = new DISPLAY_DEVICE();
DEVMODEdm = new DEVMODE();
d.cb = Marshal.SizeOf(d);
intdeviceID = 1;
EnumDisplayDevices(null, (uint)deviceID,ref d,0); //
EnumDisplaySettings(d.DeviceName, 0, refdm);
dm.dmPelsWidth = 1024;
dm.dmPelsHeight = 768;
dm.dmPositionX = Screen.PrimaryScreen.Bounds.Right;
dm.dmFields = DM_POSITION| DM_PELSWIDTH | DM_PELSHEIGHT;
ChangeDisplaySettingsEx(d.DeviceName, refdm, IntPtr.Zero,DISPLAY_DEVICE_ATTACHED_TO_DESKTOP, IntPtr.Zero);
}
}}}
#endregion