autoitrulez Posted September 13, 2006 Posted September 13, 2006 is there a way so a circle of pixels will apear around the mouse, like say it's +15, there will be a circle around the mouse with a radius of 15 or something along those lines? Thanks again
PsaltyDS Posted September 13, 2006 Posted September 13, 2006 I would personally create a "Region"ed window and WinMove it according to the mouseposLar.A what? I'm curious, what's a "Region"ed window? I get that you want a transparent GUI with the circle drawn on it, and then move the GUI to follow the mouse pointer. But I have no idea how to achieve such a GUI and that phrase was pretty opaque to me. Could you elaborate for us slow people... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
autoitrulez Posted September 13, 2006 Author Posted September 13, 2006 (edited) yes, very confsed with regioned window? is there anyway ti make a pixel or something without the gui..causer then it will use alot of cpu consumption to move the gui as the mouse moves Edited September 13, 2006 by autoitrulez
autoitrulez Posted September 13, 2006 Author Posted September 13, 2006 (edited) ESC to exit... expandcollapse popup#include <GUIConstants.au3> HotKeySet("{ESC}","bye") $GUI = GUICreate("test",30,30,-1,-1,$WS_POPUP,$WS_EX_TOPMOST) GUISetBkColor(0xFF0000) $a = CreateRoundRectRgn(0,0,30,30,30,30) $b = CreateRoundRectRgn(4,4,22,22,26,26) CombineRgn($a,$B) SetWindowRgn($GUI,$a) GUISetState() GUISetState(@SW_DISABLE) While 1 Sleep(50) $pt = MouseGetPos() If Not @error Then WinMove($GUI,"",$pt[0] - 15,$pt[1] - 15) WEnd Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc Func CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2) Return $ret[0] EndFunc Func CombineRgn(ByRef $rgn1, ByRef $rgn2) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 3) EndFunc Func bye() Exit EndFunc wow, very kool and nice, btw, which can i edit to change radius and density of circle? I c the If Not @error Then WinMove($GUI,"",$pt[0] - 15,$pt[1] - 15) line controls how center the cursor is... i clearly have to edit this to change size of circle, but shape changes also wen i edit I want to know, because I want there to b an input box to put the size in for a gui Edited September 13, 2006 by autoitrulez
CWorks Posted September 13, 2006 Posted September 13, 2006 (edited) this is how i created a bigger circle i just added ten to each of these $GUI = GUICreate("test",40,40,-1,-1,$WS_POPUP,$WS_EX_TOPMOST) GUISetBkColor(0xFF0000) $a = CreateRoundRectRgn(0,0,40,40,40,40) $b = CreateRoundRectRgn(4,4,32,32,36,36) square $GUI = GUICreate("test",50,50,-1,-1,$WS_POPUP,$WS_EX_TOPMOST) GUISetBkColor(0xFF0000) $a = CreateRoundRectRgn(0,0,50,50,10,10) $b = CreateRoundRectRgn(4,4,42,42,6,6) Edited September 13, 2006 by CWorks
Paulie Posted September 14, 2006 Posted September 14, 2006 You can look here for some info on the DLLhttp://msdn.microsoft.com/library/default....egions_7tf2.asp
Rad Posted September 14, 2006 Posted September 14, 2006 heres a little waste of effort expandcollapse popup#include <GUIConstants.au3> HotKeySet("{ESC}","bye") $GUI = GUICreate("test",200,200,-1,-1,$WS_POPUP,$WS_EX_TOPMOST) GUISetBkColor(0xFF0000) $aSize = 40 $density = 1;Keep higher than 1, and less than 1/4 Asize $Roundness = 40;0 = Square, same as $aSize makes it circle $a = CreateRoundRectRgn(0,0,$asize,$asize,$Roundness,$Roundness) $bSize = $aSize - $density*2 $b = CreateRoundRectRgn($density,$density,$bsize,$bsize,$Roundness,$Roundness) $csize = $asize/2 $c = CreateRoundRectRgn($asize/2/2,$asize/2/2,$csize,$csize,$Roundness,$Roundness) $d = CreateRoundRectRgn($asize/2/2+$density,$asize/2/2+$density,$csize-($density*2),$csize-($density*2),$Roundness,$Roundness) CombineRgn($a,$b,$c,$d) SetWindowRgn($GUI,$a) GUISetState() GUISetState(@SW_DISABLE) While 1 Sleep(50) $pt = MouseGetPos() If Not @error Then WinMove($GUI,"",$pt[0] - (($asize + $bsize) /4),$pt[1] - (($asize + $bsize) /4)) WEnd Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc Func CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2) Return $ret[0] EndFunc Func CombineRgn(ByRef $rgn1, ByRef $rgn2, ByRef $rgn3, ByRef $rgn4) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 3) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn3, "int", 3) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn4, "int", 3) EndFunc Func bye() Exit EndFunc makes it more like a dartboard u get 2 circles, and u just change the $aSize $Density and $Roundness to do exactly what they say, the rest are automatic. Should work fine ^^ this was fun
PsaltyDS Posted September 14, 2006 Posted September 14, 2006 ESC to exit... expandcollapse popup#include <GUIConstants.au3> HotKeySet("{ESC}","bye") $GUI = GUICreate("test",30,30,-1,-1,$WS_POPUP,$WS_EX_TOPMOST) GUISetBkColor(0xFF0000) $a = CreateRoundRectRgn(0,0,30,30,30,30) $b = CreateRoundRectRgn(4,4,22,22,26,26) CombineRgn($a,$B) SetWindowRgn($GUI,$a) GUISetState() GUISetState(@SW_DISABLE) While 1 Sleep(50) $pt = MouseGetPos() If Not @error Then WinMove($GUI,"",$pt[0] - 15,$pt[1] - 15) WEnd Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc Func CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2) Return $ret[0] EndFunc Func CombineRgn(ByRef $rgn1, ByRef $rgn2) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 3) EndFunc Func bye() Exit EndFunc Cool! The slow people thank you... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Uten Posted September 14, 2006 Posted September 14, 2006 Another approach is to draw a circle directly as rysoria does in his OutlineControl routine. I did not get this to work on my system erlier today thought but I think that is due to some pen and brush issues Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
PsaltyDS Posted September 14, 2006 Posted September 14, 2006 this is how i created a bigger circle i just added ten to each of these square $GUI = GUICreate("test",50,50,-1,-1,$WS_POPUP,$WS_EX_TOPMOST) GUISetBkColor(0xFF0000) $a = CreateRoundRectRgn(0,0,50,50,10,10) $b = CreateRoundRectRgn(4,4,42,42,6,6)oÝ÷ Ûú®¢×j¸nX³yÛaz¶ëºÚ"µÍÚ[ÛYH ÑÕRPÛÛÝ[Ë]LÉÝÂÝÙ^TÙ] ][ÝÞÑTÐßI][ÝË ][Ý×ÐYI][ÝÊBÌÍÚPÚÛTHÈ ÏOOHY]ÈÜY[ÚÛHY]È [^[ÊBÌÍÚPÚÛQH ÌÍÚPÚÛT ÌÍÜH[ÝÙQÙ]ÜÊ BÌÍÑÕRHHÕRPÜX]J ][ÝÝÝ ][ÝË ÌÍÚPÚÛQ ÌÍÚPÚÛQ ÌÍÜÌHH ÌÍÚPÚÛT ÌÍÜÌWHH ÌÍÚPÚÛT ÌÍÕÔ×ÔÔT ÌÍÕÔ×ÑVÕÔSÔÕ BÕRTÙ]ÐÛÛÜ BÌÍØHHÐÜX]TÝ[XÝÛ ÌÍÚPÚÛQ ÌÍÚPÚÛQ ÌÍÚPÚÛQ ÌÍÚPÚÛQ BÌÍØHÐÜX]TÝ[XÝÛ ÌÍÚPÚÛQH K ÌÍÚPÚÛQH K ÌÍÚPÚÛQH K ÌÍÚPÚÛQH JBÐÛÛX[TÛ ÌÍØK ÌÍØBÔÙ]Ú[ÝÔÛ ÌÍÑÕRK ÌÍØJBÕRTÙ]Ý]J BÕRTÙ]Ý]JÕ×ÑTÐPJBÚ[HBTÛY L BIÌÍÜH[ÝÙQÙ]ÜÊ BRYÝÜ[Ú[[ÝJ ÌÍÑÕRK ][ÝÉ][ÝË ÌÍÜÌHH ÌÍÚPÚÛT ÌÍÜÌWHH ÌÍÚPÚÛTBÑ[[ÈÐÜX]TÝ[XÝÛ ÌÍÛ ÌÍÝ ÌÍÝË ÌÍÚ ÌÍÙLK ÌÍÙLBIÌÍÜ]HØ[ ][ÝÙÙLÌ ][ÝË ][ÝÛÛÉ][ÝË ][ÝÐÜX]TÝ[XÝÛ][ÝË ][ÝÛÛÉ][ÝË ÌÍÛ ][ÝÛÛÉ][ÝË ÌÍÝ ][ÝÛÛÉ][ÝË ÌÍÛ È ÌÍÝË ][ÝÛÛÉ][ÝË ÌÍÝ È ÌÍÚ ][ÝÛÛÉ][ÝË ÌÍÙLK ][ÝÛÛÉ][ÝË ÌÍÙLBT] ÌÍÜ]ÌB[[ÈÏOIÝ×ÐÜX]TÝ[XÝÛ[ÈÐÛÛX[TÛTY ÌÍÜÛKTY ÌÍÜÛBQØ[ ][ÝÙÙLÌ ][ÝË ][ÝÛÛÉ][ÝË ][ÝÐÛÛX[TÛ][ÝË ][ÝÛÛÉ][ÝË ÌÍÜÛK ][ÝÛÛÉ][ÝË ÌÍÜÛK ][ÝÛÛÉ][ÝË ÌÍÜÛ ][ÝÚ[ ][ÝËÊB[[ÈÏOIÝ×ÐÛÛX[TÛ[ÈÔÙ]Ú[ÝÔÛ ÌÍÚÝÚ[ ÌÍÜÛBQØ[ ][ÝÝÙÌ ][ÝË ][ÝÛÛÉ][ÝË ][ÝÔÙ]Ú[ÝÔÛ][ÝË ][ÝÚÛ ][ÝË ÌÍÚÝÚ[ ][ÝÛÛÉ][ÝË ÌÍÜÛ ][ÝÚ[ ][ÝËJB[[ÈÏOIÝ×ÔÙ]Ú[ÝÔÛ[ÈØYJ BQ^][[ÈÏOIÝרY Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
PsaltyDS Posted September 14, 2006 Posted September 14, 2006 Having way too much fun playing with Larry's script! This version has it all turned in to a couple of "MouseCircle" functions, suitable for turning into a UDF. The demo script uses the fuctions to varry the circle size and color over time: expandcollapse popup; Put a ring around the mouse pointer ; Modified from a post by Larry @ http://www.autoitscript.com/forum/index.php?s=&showtopic=32676 #include <GUIConstants.au3> ; Hist ESC to quit HotKeySet("{ESC}", "_Bye") ; Setup the automated update Global $hMouseCircle = -1 ; Mouse circle GUI handle Global $rMouseCircle = 20 ; <=== Edit this value to change circle radius AdlibEnable("_MouseCircleUpdate", 125) $hMouseCircle = _MouseCircleInit($rMouseCircle, 0x00FF00) Sleep(2000) ; Show the default for 2sec ; Change circle size and color While 1 $cMouseCircle = 0xFF For $rMouseCircle = 8 To 64 If $hMouseCircle <> -1 Then _MouseCircleDelete() $hMouseCircle = _MouseCircleInit($rMouseCircle, $cMouseCircle) Sleep(1000) $cMouseCircle = $cMouseCircle * 0x2 ; left shift If $cMouseCircle > 0xFFFFFF Then $cMouseCircle = 0xFF Next WEnd ; ========================================= ; Local Functions ; ========================================= Func _MouseCircleInit($r, $Color) Local $D = $r * 2 Local $pt = MouseGetPos() Local $hGUI = GUICreate("test", $D, $D, $pt[0] - $r, $pt[1] - $r, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor($Color) Local $Reg1 = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", 0, "long", 0, "long", $D, "long", $D, "long", $D, "long", $D) Local $Reg2 = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", 4, "long", 4, "long", $D - 4, "long", $D - 4, "long", $D, "long", $D) ; _CombineRgn($Reg1[0], $Reg2[0]) DllCall("gdi32.dll", "long", "CombineRgn", "long", $Reg1[0], "long", $Reg1[0], "long", $Reg2[0], "int", 3) ; _SetWindowRgn($hGUI, $Reg1[0]) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hGUI, "long", $Reg1[0], "int", 1) GUISetState() GUISetState(@SW_DISABLE) Return $hGUI EndFunc ;==>_MouseCircleInit Func _MouseCircleUpdate() If $hMouseCircle <> -1 Then Local $pt = MouseGetPos() If Not @error Then WinMove($hMouseCircle, "", $pt[0] - $rMouseCircle, $pt[1] - $rMouseCircle) EndIf EndFunc ;==>_MouseCircleUpdate Func _MouseCircleDelete() If $hMouseCircle <> -1 Then GUIDelete($hMouseCircle) $hMouseCircle = -1 EndIf EndFunc ;==>_MouseCircleDelete Func _bye() Exit EndFunc ;==>_bye Cheers! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
mike2003 Posted September 18, 2021 Posted September 18, 2021 Is it possible to make these circles really on top of everything? Even a menu?
JockoDundee Posted September 19, 2021 Posted September 19, 2021 After 15 years of improvements to Windows, I would hope so… Code hard, but don’t hard code...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now