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