F
Franky
I try to change for landscape orientation.
i use the ChangeDisplaySettingsEx function.
----
[DllImport("coredll.dll", EntryPoint="ChangeDisplaySettingsEx",
SetLastError=true)]
internal static extern long ChangeDisplaySettingsEx(
string lpszDeviceName,
out DEVMODE lpDevMode,
IntPtr hwnd,
int dwflags,
IntPtr lParam);
---
my struct DEVMODE is
---
[StructLayout(LayoutKind.Sequential)]
public struct DEVMODE
{
string dmDeviceName;
public int dmSpecVersion;
public int dmDriverVersion;
public int dmSize;
public int dmDriverExtra;
public long dmFields;
public short dmOrientation;
public short dmPaperSize;
public short dmPaperLength;
public short dmPaperWidth;
public short dmScale;
public short dmCopies;
public short dmDefaultSource;
public short dmPrintQuality;
public short dmColor;
public short dmDuplex;
public short dmYResolution;
public short dmTTOption;
public short dmCollate;
public string dmFormName;
public int dmLogPixels;
public int dmBitsPerPel;
public int dmPelsWidth;
public int dmPelsHeight;
public int dmDisplayFlags;
public int dmDisplayFrequency;
public int dmDisplayOrientation;
}
---
I try different way... a got always a Unmanaged Exception!
Can someone HELP ME PLEASE!!!!!
i use the ChangeDisplaySettingsEx function.
----
[DllImport("coredll.dll", EntryPoint="ChangeDisplaySettingsEx",
SetLastError=true)]
internal static extern long ChangeDisplaySettingsEx(
string lpszDeviceName,
out DEVMODE lpDevMode,
IntPtr hwnd,
int dwflags,
IntPtr lParam);
---
my struct DEVMODE is
---
[StructLayout(LayoutKind.Sequential)]
public struct DEVMODE
{
string dmDeviceName;
public int dmSpecVersion;
public int dmDriverVersion;
public int dmSize;
public int dmDriverExtra;
public long dmFields;
public short dmOrientation;
public short dmPaperSize;
public short dmPaperLength;
public short dmPaperWidth;
public short dmScale;
public short dmCopies;
public short dmDefaultSource;
public short dmPrintQuality;
public short dmColor;
public short dmDuplex;
public short dmYResolution;
public short dmTTOption;
public short dmCollate;
public string dmFormName;
public int dmLogPixels;
public int dmBitsPerPel;
public int dmPelsWidth;
public int dmPelsHeight;
public int dmDisplayFlags;
public int dmDisplayFrequency;
public int dmDisplayOrientation;
}
---
I try different way... a got always a Unmanaged Exception!
Can someone HELP ME PLEASE!!!!!