WinUser.MONITORENUMPROC (JNA API)

com.sun.jna.platform.win32

## Interface WinUser.MONITORENUMPROC

- All Superinterfaces:
    AltCallingConvention, Callback, StdCall, StdCallLibrary.StdCallCallback
  Enclosing interface:
    WinUser

      public static interface WinUser.MONITORENUMPROC
      extends StdCallLibrary.StdCallCallback

  An application-defined callback function that is called by the `User32.EnumDisplayMonitors(com.sun.jna.platform.win32.WinDef.HDC, com.sun.jna.platform.win32.WinDef.RECT, com.sun.jna.platform.win32.WinUser.MONITORENUMPROC, com.sun.jna.platform.win32.WinDef.LPARAM)` function.

  You can use the EnumDisplayMonitors function to enumerate the set of display monitors that intersect the visible region of a specified device context and, optionally, a clipping rectangle. To do this, set the hdc parameter to a non-NULL value, and set the lprcClip parameter as needed.

  You can also use the EnumDisplayMonitors function to enumerate one or more of the display monitors on the desktop, without supplying a device context. To do this, set the hdc parameter of EnumDisplayMonitors to NULL and set the lprcClip parameter as needed.

  In all cases, EnumDisplayMonitors calls a specified MonitorEnumProc function once for each display monitor in the calculated enumeration set. The MonitorEnumProc function always receives a handle to the display monitor. If the hdc parameter of EnumDisplayMonitors is non-NULL, the MonitorEnumProc function also receives a handle to a device context whose color format is appropriate for the display monitor. You can then paint into the device context in a manner that is optimal for the display monitor.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.sun.jna.Callback

      `Callback.UncaughtExceptionHandler`

  - ### Field Summary

    - ### Fields inherited from interface com.sun.jna.Callback

      `FORBIDDEN_NAMES, METHOD_NAME`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `apply(WinUser.HMONITOR hMonitor, WinDef.HDC hdcMonitor, WinDef.RECT lprcMonitor, WinDef.LPARAM dwData)`

- - ### Method Detail

    - #### apply

          int apply(WinUser.HMONITOR hMonitor,
                  WinDef.HDC hdcMonitor,
                  WinDef.RECT lprcMonitor,
                  WinDef.LPARAM dwData)

      Parameters:
        `hMonitor` - A handle to the display monitor. This value will always be non-NULL.
        `hdcMonitor` - A handle to a device context. The device context has color attributes that are appropriate for the display monitor identified by hMonitor. The clipping area of the device context is set to the intersection of the visible region of the device context identified by the hdc parameter of EnumDisplayMonitors, the rectangle pointed to by the lprcClip parameter of EnumDisplayMonitors, and the display monitor rectangle.
        `lprcMonitor` - A pointer to a RECT structure. If hdcMonitor is non-NULL, this rectangle is the intersection of the clipping area of the device context identified by hdcMonitor and the display monitor rectangle. The rectangle coordinates are device-context coordinates. If hdcMonitor is NULL, this rectangle is the display monitor rectangle. The rectangle coordinates are virtual-screen coordinates.
        `dwData` - Application-defined data that EnumDisplayMonitors passes directly to the enumeration function.
      Returns:
        To continue the enumeration, return TRUE. To stop the enumeration, return FALSE.

Copyright © 2007-2016 Timothy Wall. All Rights Reserved.