Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

MONITORINFOEX (user32)
 
.

The MONITORINFOEX structure contains information about a display monitor.

The GetMonitorInfo function stores information into a MONITORINFOEX structure or a MONITORINFO structure.

The MONITORINFOEX structure is a superset of the MONITORINFO structure. The MONITORINFOEX structure adds a string member to contain a name for the display monitor.

C# Definition:

// size of a device name string
private const int CCHDEVICENAME = 32;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct MonitorInfoEx
{
    public int cbSize;
    public RECT rcMonitor;
    public RECT rcWork;
    public UInt32 dwFlags;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst=CCHDEVICENAME)]
    public string szDeviceName;
}

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

If the monitor is the primary monitor the flag will be set too MONITORINFOF_PRIMARY. The declaration for MONITORINFOF_PRIMARY is

const uint MONITORINFOF_PRIMARY = 1;

Tips & Tricks:

Set cbSize to 72 before using MonitorInfoEx

Sample Code:

Please add some!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions