Jump to content

Search the Community

Showing results for tags 'multi-monitor'.

  • 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. Given a specific XY coordinate, this snippet returns the handle to the monitor the coordinate appears on... or 0 if it is off all screens. Particularly useful in multiple monitor setups where monitors have different resolutions or are offset vertically or horizontally (in which case, there are areas of the virtual desktop that are off all screens). You could also use it to return the handle of the monitor where a window is placed, or where the mouse was clicked, or other similar applications. #include <WinAPIGdi.au3> ;for _WinOnMonitor() Func _WinOnMonitor($iXPos, $iYPos) Local $aMonitors = _WinAPI_EnumDisplayMonitors() If IsArray($aMonitors) Then ReDim $aMonitors[$aMonitors[0][0] + 1][5] For $ix = 1 To $aMonitors[0][0] $aPos = _WinAPI_GetPosFromRect($aMonitors[$ix][1]) For $j = 0 To 3 $aMonitors[$ix][$j + 1] = $aPos[$j] Next Next EndIf For $ixMonitor = 1 to $aMonitors[0][0] ; Step through array of monitors If $iXPos > $aMonitors[$ixMonitor][1] And $iXPos < $aMonitors[$ixMonitor][1] + $aMonitors[$ixMonitor][3] Then If $iYPos > $aMonitors[$ixMonitor][2] And $iYPos < $aMonitors[$ixMonitor][2] + $aMonitors[$ixMonitor][4] Then Return $aMonitors[$ixMonitor][0] ; return handle to monitor coordinate is on EndIf EndIf Next Return 0 ;Return 0 if coordinate is on none of the monitors EndFunc ;==> _WinOnMonitor
×
×
  • Create New...