@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: This structure defines various properties about a display device. It is used by the EnumDisplayDevices method. !!!!C# Definition: [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] public struct DISPLAY_DEVICE { [MarshalAs(UnmanagedType.U4)] public int cb; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)] public string DeviceName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string DeviceString; [MarshalAs(UnmanagedType.U4)] public DisplayDeviceStateFlags StateFlags; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string DeviceID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string DeviceKey; } !!!!VB.NET Definition: <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _ Public Structure DISPLAY_DEVICE <MarshalAs(UnmanagedType.U4)> _ Public cb As Integer <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> _ Public DeviceName As String <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> _ Public DeviceString As String <MarshalAs(UnmanagedType.U4)> _ Public StateFlags As DisplayDeviceStateFlags <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> _ Public DeviceID As String <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> _ Public DeviceKey As String End Structure !!!!User-Defined Types DisplayDeviceStateFlags !!!!Notes: Used with EnumDisplayDevices Works much better on Win7 with CharSet=CharSet.Auto. Suspect this is true of a bunch of other structs defined on this site as well as with at least a few predecessors of Win7. On my Windows 7 I build for x86 I need to use CharSet.Ansi, thats why I revert it back. Feel free and try for yourself. Documentation: DISPLAY_DEVICE@msdn on MSDN
Edit Structures.DISPLAY
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.