Jump to content

Search the Community

Showing results for tags 'GetMonitorInfo'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I can get the 'workarea' of the primary monitor using: Func _GetDesktopArea() Local Const $SPI_GETWORKAREA = 48 Local $tWorkArea = DllStructCreate($tagRECT) _WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, DllStructGetPtr($tWorkArea)) Local $aReturn[4] = [DllStructGetData($tWorkArea, "Left"), DllStructGetData($tWorkArea, "Top"), _ DllStructGetData($tWorkArea, "Right") - DllStructGetData($tWorkArea, "Left"), DllStructGetData($tWorkArea, "Bottom") - DllStructGetData($tWorkArea, "Top")] Return $aReturn EndFunc ;==>_GetDesktopArea MSDN says to use GetMonitorInfo() to get workarea of monitors other than the Primary. However, when I do this the rect I receive from this function for Primary or Secondary is not a workarea, but a fullscreen rect. #include <WinApi.au3> #include <Array.au3> #include <StructureConstants.au3> ;get monitor handles Local $edm=_WinAPI_EnumDisplayMonitors();$hDC = 0, $tRECT = 0 If @Error Then MsgBox(0,'Error','_WinAPI_EnumDisplayMonitors') Local $mh1=$edm[2][0]; 1 for first handle, 2 for second Local $mr1=$edm[1][1]; supposedly a rect ; use my handle to get monitor infos Local $vh=_WinAPI_GetMonitorInfo($mh1) If @Error Then MsgBox(0,'Error','_WinAPI_GetMonitorInfo') ; $vh now filled with ; [0] - $tagRECT structure that specifies the display monitor rectangle, in virtual-screen coordinates. ; [1] - $tagRECT structure that specifies the work area rectangle of the display monitor that can be used by applications, in virtual-screen coordinates. ; [2] - 1 (True) for the primary display monitor, or 0 (False) otherwise. ; [3] - The device name of the monitor being used, e.g. "\\.\DISPLAY1". Local $aReturn[4] = [DllStructGetData($vh[1], 'Left') _ ,DllStructGetData($vh[1], 'Top') _ ,DllStructGetData($vh[1], 'Right') - DllStructGetData($vh[1], 'Left') _ ,DllStructGetData($vh[1], 'Bottom') - DllStructGetData($vh[1], 'Top') _ ] _ArrayDisplay($aReturn) Exit So to reiterate- the MonitorInfo workarea rect does not jive with the one gotten with SPI for the Primary monitor, therefore it doesn't work for the Secondary monitor either - it just gets the true (virtual) dimensions. I smell a Microsoft thing. I have looked on StackOverflow with no success. Can anyone get a workarea!=desktop with this code?
×
×
  • Create New...