Click here to Skip to main content
15,921,990 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing null Pin
leppie2-Sep-02 12:11
leppie2-Sep-02 12:11 
GeneralRe: Passing null Pin
Rickard Andersson202-Sep-02 10:45
Rickard Andersson202-Sep-02 10:45 
GeneralDisplay Mode Pin
Nnamdi Onyeyiri2-Sep-02 2:22
Nnamdi Onyeyiri2-Sep-02 2:22 
GeneralRe: Display Mode Pin
leppie2-Sep-02 3:00
leppie2-Sep-02 3:00 
GeneralRe: Display Mode Pin
Nnamdi Onyeyiri2-Sep-02 3:16
Nnamdi Onyeyiri2-Sep-02 3:16 
GeneralRe: Display Mode Pin
leppie2-Sep-02 3:31
leppie2-Sep-02 3:31 
GeneralRe: Display Mode Pin
Nnamdi Onyeyiri2-Sep-02 3:39
Nnamdi Onyeyiri2-Sep-02 3:39 
GeneralRe: Display Mode - SOLUTION :) Pin
leppie2-Sep-02 4:02
leppie2-Sep-02 4:02 
DEVMODE dm = new DEVMODE();
dm.dmSize = (short)Marshal.SizeOf(typeof(DEVMODE));
int mode = 0;
while (EnumDisplaySettings(null, mode++, ref dm) != 0)
{
	Console.WriteLine("{0}x{1}, {2}bits {3}hz",
		dm.dmPelsWidth, dm.dmPelsHeight, dm.dmBitsPerPel, dm.dmDisplayFrequency);
}

[DllImport("user32.dll", CharSet=CharSet.Ansi)]
static extern int EnumDisplaySettings(StringBuilder devname, int mode, ref DEVMODE devmode);

public struct DEVMODE 
{
	[MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)]
	public string dmDeviceName; 
	public short dmSpecVersion; 
	public short dmDriverVersion; 
	public short dmSize; 
	public short dmDriverExtra; 
	public int  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; 
	[MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)]
	public string  dmFormName; 
	public short  dmLogPixels; 
	public int  dmBitsPerPel; 
	public int  dmPelsWidth; 
	public int  dmPelsHeight; 
	public int  dmDisplayFlags; //funny union??
	//public int  dmNup;
	public int  dmDisplayFrequency; 
	public int  dmICMMethod;
	public int  dmICMIntent;
	public int  dmMediaType;
	public int  dmDitherType;
	public int  dmReserved1;
	public int  dmReserved2;
	public int  dmPanningWidth;
	public int  dmPanningHeight;
}


This works Smile | :) Note the union ???? looks like it combines 2 int 's ???

MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc
for more info. Big Grin | :-D
GeneralRe: Display Mode - SOLUTION :) Pin
Nnamdi Onyeyiri2-Sep-02 4:51
Nnamdi Onyeyiri2-Sep-02 4:51 
GeneralRe: Display Mode - SOLUTION :) Pin
leppie2-Sep-02 5:02
leppie2-Sep-02 5:02 
GeneralRe: Display Mode - SOLUTION :) Pin
Paul Riley2-Sep-02 5:57
Paul Riley2-Sep-02 5:57 
GeneralRe: Display Mode - SOLUTION :) Pin
leppie2-Sep-02 6:12
leppie2-Sep-02 6:12 
GeneralRe: Display Mode - SOLUTION :) Pin
Paul Riley2-Sep-02 8:00
Paul Riley2-Sep-02 8:00 
GeneralRe: Display Mode - SOLUTION :) Pin
Paul Ingles2-Sep-02 7:52
Paul Ingles2-Sep-02 7:52 
GeneralRe: Display Mode - SOLUTION :) Pin
James T. Johnson2-Sep-02 9:38
James T. Johnson2-Sep-02 9:38 
GeneralRe: Display Mode - SOLUTION :) Pin
Paul Riley2-Sep-02 9:52
Paul Riley2-Sep-02 9:52 
QuestionArray of strings to old DLL? Pin
EdgarBM1-Sep-02 23:25
EdgarBM1-Sep-02 23:25 
AnswerRe: Array of strings to old DLL? Pin
Stephane Rodriguez.1-Sep-02 23:38
Stephane Rodriguez.1-Sep-02 23:38 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 1:14
EdgarBM2-Sep-02 1:14 
GeneralRe: Array of strings to old DLL? Pin
Stephane Rodriguez.2-Sep-02 1:33
Stephane Rodriguez.2-Sep-02 1:33 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 1:52
EdgarBM2-Sep-02 1:52 
AnswerRe: Array of strings to old DLL? Pin
leppie2-Sep-02 1:50
leppie2-Sep-02 1:50 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 2:10
EdgarBM2-Sep-02 2:10 
GeneralRe: Array of strings to old DLL? Pin
leppie2-Sep-02 2:33
leppie2-Sep-02 2:33 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 21:44
EdgarBM2-Sep-02 21:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.