GefApplication.GetMonitorRect (method)

Gets the rectangle a monitor ocupies in virtual screen coordinates.
Syntax: Boolean = object.GetMonitorRect ( MonitorIndex, left, top, right, bottom )
Parameters:
MonitorIndex As long - A one based monitor index. This corresponds the numbers seen on the "Settings" page of the "Display Properties".
left As long* -
top As long* -
right As long* -
bottom As long* -
Description: Gets the rectangle a monitor ocupies in virtual screen coordinates. Returns "True" if the monitor exists, and is attached to the desktop. Otherwise it returns "False."

Examples

Sub Application_GetMonitorRect()
  Dim oCimApp as GefApplication
  Dim left as long
  Dim top as long
  Dim right as long
  Dim bottom as long
  Set oCimApp = CimGetScreen.Application
  If oCimApp.GetMonitorRect(2, left, top, right, bottom) Then
    MsgBox "Monitor 2 was has position, left: " & left & " top: " & top & " right:" & right & " bottom: " & bottom
  Else
    MsgBox "Monitor 2 was not found"
  End If
End Sub
See Also: GetMonitorWorkingRect , MonitorCount