ChangeDisplaySettings API
I am using the ChangeDisplaySettings API and was wondering if it has the ability to change screen orientation. Meaning if there are two monitors if it is set as clone, or span. The structure for this has a member called dmPosition which according to MSDN "Windows 98/Me, Windows 2000/XP: Position of the device in a multimonitor configuration". But I don't think that is it.
If this API doesn't have that ability, if anyone knows of another api, or some other way to set the multimonitor configuration that would be great.
Thanks
Re: ChangeDisplaySettings API
Ok I've made it a bit farther. I am using the ChangeDisplaySettingsEX API. This api enables me to select which monitor to change the display settings on. I am having one issue with it when I try and change the position of the secondary monitor. No matter what point I use it always goes to the left of the primary screen, which is always located at 0,0. Does anyone have any idea why this is occuring? Here is a short snippet of code.
VB Code:
Private Declare Function ChangeDisplaySettingsEx Lib "user32.dll"_
Alias "ChangeDisplaySettingsExA" (ByVal lpszDeviceName As String,_
ByRef lpDevMode As DEVMODE, ByVal hwnd As Int32, ByVal dwflags As Int32,_
ByVal lParam As Int32) As Int32
Public Sub ChangeSettings(ByVal DeviceName as String)
Dim DevM as DEVMODE
DevM.dmSize = CShort(Marshal.SizeOf(DevM))
DevM.dmFields = DM_POSITION
DevM.dmPostion = New Point(0,1024) ' if the primary monitor resolution is set to 1280 X 1024 this should put the secondary screen under the primary
lResult = ChangeDisplaySettingsEx(DeviceName, DevM, 0&, CDS_UPDATEREGISTRY, 0&)
End Sub
I'll take any help I can get. If you have any other ideas on how I can go about changing the displaysettings I would love to hear it.
Thanks