Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

activeMonitorInfo - get monitor resolution and origin from of monitor with mouse on


  • Please log in to reply
1 reply to this topic
Bluesmaster
  • Members
  • 23 posts
  • Last active: Mar 22 2016 06:49 PM
  • Joined: 17 Aug 2013

Just a little script I have not found yet anywhere else. Maybe someone can make use of it.

while not getkeystate( "LButton" , "P" )
{
	activeMonitorInfo( X , Y ,  Width , Height   )
	ToolTip,  %X%   %Y%   %Width%   %Height%
	Sleep 50
}


activeMonitorInfo( ByRef X, ByRef Y, ByRef Width,  ByRef  Height  )
{ ; retrieves the size of the monitor, the mouse is on
	
	CoordMode, Mouse, Screen
	MouseGetPos, mouseX , mouseY
	SysGet, monCount, MonitorCount
	Loop %monCount%
    { 	SysGet, curMon, Monitor, %a_index%
        if ( mouseX >= curMonLeft and mouseX <= curMonRight and mouseY >= curMonTop and mouseY <= curMonBottom )
            {
				X      := curMonTop
				y      := curMonLeft
				Height := curMonBottom - curMonTop
				Width  := curMonRight  - curMonLeft
				return
			}
    }
}

best regards

 

Blues



b0dhikey
  • Members
  • 44 posts
  • Last active: Nov 06 2015 02:43 AM
  • Joined: 26 Jan 2014

Hey thank you Blues! I found this useful in a windowing script!