Get monitor that mouse is in

Post your working scripts, libraries and tools
User avatar
Posts: 675
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Get monitor that mouse is in

15 Nov 2018, 07:41

You're welcome! Image
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
Posts: 2478
Joined: 09 Oct 2013, 10:31

Re: Get monitor that mouse is in

16 Nov 2018, 14:34

Maestr0 wrote:
03 Nov 2018, 04:20
Ah, yes, the issue was the hotkey, if you move it down past the last Gui, Show line, it works. I've updated the code in the top post.
based on your indentation of the autoexec, the placement of your Return line, which normally would end the autoexec, is incorrect. the autoexec continues until the first Return statement, OR until the first hotkey. by putting the F12:: hotkey where you have it, the autoexec is implicitely ended, and therefore your Return is unnecessary (and would be in the wrong spot).

should be this:

Code: Select all

	Final_x := max(mwa%ActiveMon%left, min(Mx, mwa%ActiveMon%right - W))
	Final_y := max(mwa%ActiveMon%top, min(My, mwa%ActiveMon%bottom - H))
	Gui, Show, x%Final_x% y%Final_y%

F12:: Reload ; press F12 to show the GUI, to see if it does what we want

MWAGetMonitorMouseIsIn() ; we didn't actually need the "Monitor = 0"

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Delta Pythagorean, Google [Bot], thenitesharya and 42 guests