Also...
@Luigi:
Die Idee mit dem Y-Kabel hatte ich auch schon, allerdings hab ich auf die schnelle keines bekommen, und auch keine Stecker um mir eines zu löten.
@Tommicassi:
Nunja... Clonen wird generell vom Grafikkartentreiber gemacht, und dann auch nur wenn es eine Karte ist.
@Thomas:
Naja es sind spezielle Grafikkarten, daher das Problem. Sonst hätte ich eine G450 reingesteckt.
@Luigi2:
Ohne Worte
Code:
Option Explicit
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" (ByVal lpszDevicename As String, ByVal iModeNum As Long, ByRef lpDevMode As DEVMODE) As Long
Private Declare Function ChangeDisplaySettingsEx Lib "user32.dll" Alias "ChangeDisplaySettingsExA" (ByVal lpszDevicename As String, lpDevMode As DEVMODE, ByVal hwnd As Long, ByVal dwflags As Long, ByVal lParam As Long) As Long
Const CCDEVICENAME As Long = 32&
Const CCFORMNAME As Long = 32&
Const DM_PELSWIDTH As Long = &H80000
Const DM_PELSHEIGHT As Long = &H100000
Const CDS_UPDATEREGISTRY As Long = &H1&
Const DISP_CHANGE_SUCCESSFUL As Long = 0&
Const DISP_CHANGE_RESTART As Long = 1&
Const ENUM_CURRENT_SETTINGS As Long = -1&
Private Type DEVMODE
dmDeviceName As String * CCDEVICENAME
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperLength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmYResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName As String * CCFORMNAME
dmUnusedPadding As Integer
dmBitsPerPel As Integer
dmPelsWidth As Long
dmPelsHeight As Long
dmDisplayFlags As Long
dmDisplayFrequency As Long
End Type
Dim myWidth As Long
Dim myHeight As Long
Private Sub Form_Load()
Dim myCounter As Long
myWidth = 321
myHeight = 240
Me.Move myWidth * -15, 0, myWidth * 15, myHeight * 15
Timer1.Interval = 1000 / 60
Timer2.Interval = 1000
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim myDC As Long
myDC = GetDC(GetDesktopWindow)
BitBlt Me.hDC, 0, 0, myWidth, myHeight, myDC, 0, 0, vbSrcCopy
DeleteObject myDC
End Sub
Public Function CheckDisplayResolution() As Boolean
Dim typDM1 As DEVMODE
Dim lRet As Long
Dim iResp As Integer
lRet = EnumDisplaySettings("\\.\DISPLAY1", ENUM_CURRENT_SETTINGS, typDM1)
If lRet = 0 Then Exit Function
If typDM1.dmPelsWidth = myWidth And typDM1.dmPelsHeight = myHeight Then Exit Function
myWidth = typDM1.dmPelsWidth
myHeight = typDM1.dmPelsHeight
typDM1.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
lRet = ChangeDisplaySettingsEx("\\.\DISPLAY2", typDM1, 0&, CDS_UPDATEREGISTRY, 0&)
Select Case lRet
Case DISP_CHANGE_SUCCESSFUL
CheckDisplayResolution = True
Me.Move myWidth * -15, 0, myWidth * 15, myHeight * 15
Case Else
CheckDisplayResolution = False
End Select
End Function
Private Sub Timer2_Timer()
CheckDisplayResolution
End Sub