aa2zz6

Is it possible to add a color buffer underneath a record mouse position?

3 posts in this topic

So I was wondering if it was possible to add some type of buffer that goes underneath the record mouse position when it's clicked. So if the mouse is positioned at 0,0 and the user clicks the cursor will display 0,0 but is it possible to add some type of color buffer underneath it? The text color is black and the buffer color underneath it would be all white.

Here's the record mouse position code.

#include <Misc.au3>

HotKeySet("{END}", "_Quit") ; Hit "END" to quit

$dll = DllOpen("user32.dll")
While 1
    If _IsPressed("01", $dll) Then
        $avMousePos = MouseGetPos()
        ToolTip("x = " & $avMousePos[0] & "  y = " & $avMousePos[1])
    EndIf
WEnd

Func _Quit()
    DllClose($dll)
    Exit
EndFunc   ;==>_Quit

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hey aa2zz6,

If I understand your request correctly, Then you are looking for something like this:

#include <Misc.au3>
#include<GUIconstants.au3>
HotKeySet("{END}", "_Quit") ; Hit "END" to quit
$dll = DllOpen("user32.dll")

;Create A Semi-Transparent GUI
$iWidth = 40 ;width for the highlight
$iHeight = 40 ;Height for the highlight
$hGUI = GUIcreate("",$iWidth,$iHeight,-1,-1,$WS_POPUP,$WS_EX_TOPMOST) ;Create the highlighter $WS_POPUP = no gui bar, $WS_EX_TOPMOST = always on top
GUISetBkColor(0xFFFFFF,$hGUI) ;Set the colour of the GUI to white
WinSetTrans($hGUI,"",100) ;Set the transparancy of the gui (from 0 - 255, 0 being invisible, 255 being solid)
GUISetState(@SW_SHOW) ;Show the GUI

While 1
    If _IsPressed("01", $dll) Then
        $avMousePos = MouseGetPos()
        WinMove($hGUI,"",$avMousePos[0] - ($iWidth / 2),$avMousePos[1] - ($iHeight/ 2)) ;Move Centre of GUI to where mouse was clicked
        ToolTip("x = " & $avMousePos[0] & "  y = " & $avMousePos[1])
    EndIf
WEnd

Func _Quit()
    DllClose($dll)
    Exit
EndFunc   ;==>_Quit

Cheers
 

Javi

Edited by javiwhite
Change colour val from yellow to white as per OP's request
1 person likes this

give a man an application, and he'll be frustrated for the day, Teach him how to program applications and he'll be frustrated for a lifetime.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This is exactly what I was thinking of creating. Thank you Javi.

Edited by aa2zz6

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now