This repository was archived by the owner on Jul 26, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 228
Additional functions: EnumDisplayDevices #472
Merged
AArnott
merged 2 commits into
dotnet:master
from
weitzhandler:feature/additional-functions
Jul 1, 2020
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright © .NET Foundation and Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace PInvoke | ||
{ | ||
using System.Runtime.InteropServices; | ||
|
||
/// <content> | ||
/// Contains the <see cref="DISPLAY_DEVICE"/> nested type. | ||
/// </content> | ||
public partial class User32 | ||
{ | ||
/// <summary> | ||
/// Receives information about the display device specified by the <c>iDevNum</c> parameter of the <see cref="User32.EnumDisplayDevices(string, uint, DISPLAY_DEVICE*, EnumDisplayDevicesFlags)"/> function. | ||
/// </summary> | ||
public unsafe struct DISPLAY_DEVICE | ||
{ | ||
/// <summary> | ||
/// Size, in bytes, of the DISPLAY_DEVICE structure. This must be initialized prior to calling <see cref="User32.EnumDisplayDevices(string, uint, DISPLAY_DEVICE*, EnumDisplayDevicesFlags)"/>. | ||
/// </summary> | ||
public uint cb; | ||
|
||
/// <summary> | ||
/// An array of characters identifying the device name. This is either the adapter device or the monitor device. | ||
/// </summary> | ||
public fixed char DeviceName[32]; | ||
|
||
/// <summary> | ||
/// An array of characters containing the device context string. This is either a description of the display adapter or of the display monitor. | ||
/// </summary> | ||
public fixed char DeviceString[128]; | ||
|
||
/// <summary> | ||
/// Device state flags. | ||
/// </summary> | ||
public DisplayDeviceFlags StateFlags; | ||
|
||
/// <summary> | ||
/// Not used. | ||
/// </summary> | ||
public fixed char DeviceID[128]; | ||
|
||
/// <summary> | ||
/// Reserved. | ||
/// </summary> | ||
public fixed char DeviceKey[128]; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DISPLAY_DEVICE"/> struct | ||
/// with the <see cref="cb" /> field initialized. | ||
/// </summary> | ||
/// <returns> | ||
/// An instance of the structure. | ||
/// </returns> | ||
public static DISPLAY_DEVICE Create() => new DISPLAY_DEVICE { cb = (uint)Marshal.SizeOf(typeof(DISPLAY_DEVICE)) }; | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright © .NET Foundation and Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace PInvoke | ||
{ | ||
using System; | ||
|
||
/// <content> | ||
/// Contains the <see cref="DisplayDeviceFlags"/> nested type. | ||
/// </content> | ||
public partial class User32 | ||
{ | ||
/// <summary> | ||
/// Device state flags. | ||
/// </summary> | ||
[Flags] | ||
public enum DisplayDeviceFlags : uint | ||
{ | ||
/// <summary> | ||
/// DISPLAY_DEVICE_ACTIVE specifies whether a monitor is presented as being "on" by the respective GDI view. | ||
/// Windows Vista: EnumDisplayDevices will only enumerate monitors that can be presented as being "on". | ||
/// </summary> | ||
DISPLAY_DEVICE_ACTIVE = 0x00000001, | ||
|
||
/// <summary> | ||
/// Represents a pseudo device used to mirror application drawing for remoting or other purposes. An invisible pseudo monitor is associated with this device. | ||
/// For example, NetMeeting uses it. Note that <see cref="User32.GetSystemMetrics(User32.SystemMetric)"/> (SM_MONITORS) only accounts for visible display monitors. | ||
/// </summary> | ||
DISPLAY_DEVICE_MIRRORING_DRIVER = 0x00000008, | ||
|
||
/// <summary>The device has more display modes than its output devices support.</summary> | ||
DISPLAY_DEVICE_MODESPRUNED = 0x08000000, | ||
|
||
/// <summary> | ||
/// The primary desktop is on the device. For a system with a single display card, this is always set. | ||
/// For a system with multiple display cards, only one device can have this set. | ||
/// </summary> | ||
DISPLAY_DEVICE_PRIMARY_DEVICE = 0x00000004, | ||
|
||
/// <summary>The device is removable; it cannot be the primary display.</summary> | ||
DISPLAY_DEVICE_REMOVABLE = 0x00000020, | ||
|
||
/// <summary>The device is VGA compatible.</summary> | ||
DISPLAY_DEVICE_VGA_COMPATIBLE = 0x00000010, | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright © .NET Foundation and Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace PInvoke | ||
{ | ||
/// <content> | ||
/// Contains the <see cref="EnumDisplayDevicesFlags"/> nested type. | ||
/// </content> | ||
public partial class User32 | ||
{ | ||
public enum EnumDisplayDevicesFlags : uint | ||
{ | ||
EDD_GET_DEVICE_INTERFACE_NAME = 0x00000001, | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.