@likethevegetable
How are you trying to trigger it from another script? Using a hotkey? Using a GUI button?
Cursor Highlighter
-
- Posts: 85
- Joined: 05 May 2021, 08:54
Re: Cursor Highlighter
@lblb: This would be through a launcher/run gui | made--I type "mou" and it sends the input. Note that I've used this paradigm for many, many other hotkeys that I don't care to remember, and all works fine. I figured input level might be at play.
it actually turns out the ctrl+alt+m (^!m) works, but windows+shift+m doesn't, strange. I ultimately made the hotkey ctrl+alt+win+m and it works.
it actually turns out the ctrl+alt+m (^!m) works, but windows+shift+m doesn't, strange. I ultimately made the hotkey ctrl+alt+win+m and it works.
Re: Cursor Highlighter
@likethevegetable
I'm glad you found a solution to your problem!
I'm glad you found a solution to your problem!
Re: Cursor Highlighter
I like this script very much and it is really helpful.
Sometimes I would like to have one or two movable arrow or hand picutures which are not following the mouse (as in this script) but can be moved with the mouse (click and move). Such that I can put it somewhere on the screen to highlight some aspects there while sharing the screen in a webmeeting.
Can this be done with this script or with an other script?
Sometimes I would like to have one or two movable arrow or hand picutures which are not following the mouse (as in this script) but can be moved with the mouse (click and move). Such that I can put it somewhere on the screen to highlight some aspects there while sharing the screen in a webmeeting.
Can this be done with this script or with an other script?
Re: Cursor Highlighter
@MouseTrap
I'm glad you like my little script.
Unfortunately, what you suggest is not possible with this script. But I'll keep your suggestion in my files for a future update. In the meantime, maybe you could use something like the free program "Epic Pen" to annotate your screen and add arrows. It's pretty awesome.
I'm glad you like my little script.
Unfortunately, what you suggest is not possible with this script. But I'll keep your suggestion in my files for a future update. In the meantime, maybe you could use something like the free program "Epic Pen" to annotate your screen and add arrows. It's pretty awesome.
Re: Cursor Highlighter
My five y.o. son uses this one with your script
Spoiler
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
Re: Cursor Highlighter
@amateur+
Haha! That's cute!
Haha! That's cute!
Re: Cursor Highlighter
Scalable, with left click indicator.
Code: Select all
;***************************************************************************************************
#Include, <My Altered GDIP LIB> ;GDIP.ahk
;***************************************************************************************************
#SingleInstance force
CoordMode, Mouse, screen
SetBatchLines, -1
GDIP_StartUp()
ScaleFactor := 1
MouseGetPos, x, y
global Gui1 := New PopUpWindow( { AutoShow: 1 , X: x - 65 * ScaleFactor , Y: y - 12 * ScaleFactor , W: 130 * ScaleFactor, H: 60 * ScaleFactor , Options: " -DPIScale +AlwaysOnTop Toolwindow E0x20" } )
;~ Gui1.ProgressColor := "FF0000" ;RED
;~ Gui1.ProgressColor := "FFFF00" ;YELLOW
Gui1.ProgressColor := "00FF00" ;GREEN
;~ Gui1.ProgressColor := "00FFFF" ;AQUA
;~ Gui1.ProgressColor := "0000FF" ;BLUE
;~ Gui1.ProgressColor := "FF00FF" ;PURPLE
Gui1.DrawBitmap( HB_BITMAP_MAKER( ScaleFactor ) , { X: 0 , Y: 0 , W: Gui1.W , H: Gui1.H } , dispose := 1 , 1 )
SetTimer, WatchCursor, 10
Gui1.Count := 0
return
*ESC::ExitApp
;~ RAlt::PopUpWindow.Helper()
WatchCursor:
MouseGetPos, x, y
if( x != lx || y != ly ){
Gui1.UpdateSettings( { X: x - 65 * ScaleFactor , Y: y - 12 * ScaleFactor } )
Gui1.ShowWindow()
lx := x , ly := y
}
return
~LButton::
SetTimer, CountDownAnimation, Off
sleep, 10
Gui1.Count := 180
Gui1.ClearWindow()
Gui1.DrawBitmap( HB_BITMAP_MAKER( ScaleFactor ) , { X: 0 , Y: 0 , W: Gui1.W , H: Gui1.H } , dispose := 1 , 1 )
return
~LButton Up::
SetTimer, CountDownAnimation, 30
return
CountDownAnimation:
if( !Gui1.Count -= 10 )
SetTimer, CountDownAnimation, Off
Gui1.ClearWindow()
Gui1.DrawBitmap( HB_BITMAP_MAKER( ScaleFactor ) , { X: 0 , Y: 0 , W: Gui1.W , H: Gui1.H } , dispose := 1 , 1 )
return
HB_BITMAP_MAKER( ScaleFactor := 1 ){
;Bitmap Created Using: HB Bitmap Maker
pBitmap := Gdip_CreateBitmap( 130 * ScaleFactor , 60 * ScaleFactor ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
Brush := Gdip_CreateLineBrushFromRect( 6 * ScaleFactor , 7 * ScaleFactor , 124 * ScaleFactor , 48 * ScaleFactor , "0x00000000" , "0x33000000" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 11 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawArc( G , Pen , 10 * ScaleFactor , -30 * ScaleFactor , 110 * ScaleFactor , 80 * ScaleFactor , 0 , 180 ) , Gdip_DeletePen( Pen )
Pen := Gdip_CreatePen( "0x99000000" , 7 ) , Gdip_DrawArc( G , Pen , 10 * ScaleFactor , -30 * ScaleFactor , 110 * ScaleFactor , 80 * ScaleFactor , 0 , 180 ) , Gdip_DeletePen( Pen )
Brush := Gdip_CreateLineBrush( 6 * ScaleFactor , 46 * ScaleFactor , 127 * ScaleFactor , 83 * ScaleFactor , "0x33" Gui1.ProgressColor , "0xff" Gui1.ProgressColor , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 5 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawArc( G , Pen , 10 * ScaleFactor , -30 * ScaleFactor , 110 * ScaleFactor , 80 * ScaleFactor , -180 , -Gui1.Count ) , Gdip_DeletePen( Pen )
Brush := Gdip_BrushCreateSolid( "0xFF" Gui1.ProgressColor ) , Gdip_FillEllipse( G , Brush , 62 * ScaleFactor , 9 * ScaleFactor , 6 * ScaleFactor , 6 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_FillEllipse( G , Brush , 63 * ScaleFactor , 10 * ScaleFactor , 4 * ScaleFactor , 4 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Gdip_DeleteGraphics( G )
return pBitmap
}
;####################################################################################################################################################################################
;####################################################################################################################################################################################
;####################################################################################################################################################################################
;####################################################################################################################################################################################
class PopUpWindow {
;PopUpWindow v2
;Date Written: Oct 28th, 2021
;Written By: Hellbent aka CivReborn
;SpcThanks: teadrinker , malcev
static Index := 0 , Windows := [] , Handles := [] , EditHwnd , HelperHwnd
__New( obj := "" ){
This._SetDefaults()
This.UpdateSettings( obj )
This._CreateWindow()
This._CreateWindowGraphics()
if( This.AutoShow )
This.ShowWindow( This.Title )
}
_SetDefaults(){
This.X := 10
This.Y := 10
This.W := 10
This.H := 10
This.Smoothing := 2
This.Options := " -DPIScale +AlwaysOnTop "
This.AutoShow := 0
This.GdipStartUp := 0
This.Title := ""
This.Controls := []
This.Handles := []
This.Index := 0
}
AddTrigger( obj ){
local k , v , cc , bd
This.Controls[ ++This.Index ] := { X: 10
, Y: 10
, W: 10
, H: 10 }
for k, v in obj
This.Controls[ This.Index ][ k ] := obj[ k ]
cc := This.Controls[ This.Index ]
Gui, % This.Hwnd ":Add", Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd"
This.Handles[ hwnd ] := This.Index
This.Controls[ This.Index ].Hwnd := hwnd
return hwnd
}
DrawTriggers( color := "0xFFFF0000" , AutoUpdate := 0 ){
local brush , cc
Brush := Gdip_BrushCreateSolid( color )
Gdip_SetSmoothingMode( This.G , 3 )
loop, % This.Controls.Length() {
cc := This.Controls[ A_Index ]
Gdip_FillRectangle( This.G , Brush , cc.x , cc.y , cc.w , cc.h )
}
Gdip_DeleteBrush( Brush )
Gdip_SetSmoothingMode( This.G , This.Smoothing )
if( AutoUpdate )
This.UpdateWindow()
}
UpdateSettings( obj := "" , UpdateGraphics := 0 ){
local k , v
if( IsObject( obj ) )
for k, v in obj
This[ k ] := obj[ k ]
( This.X = "Center" ) ? ( This.X := ( A_ScreenWidth - This.W ) / 2 )
( This.Y = "Center" ) ? ( This.Y := ( A_ScreenHeight - This.H ) / 2 )
if( UpdateGraphics ){
This._DestroyWindowsGraphics()
This._CreateWindowGraphics()
}
}
_CreateWindow(){
local hwnd
Gui , New, % " +LastFound +E0x80000 hwndhwnd -Caption " This.Options
PopUpWindow.Index++
This.Index := PopUpWindow.Index
PopUpWindow.Windows[ PopUpWindow.Index ] := This
This.Hwnd := hwnd
PopUpWindow.Handles[ hwnd ] := PopUpWindow.Index
if( This.GdipStartUp && !PopUpWindow.pToken )
PopUpWindow.pToken := GDIP_STARTUP()
}
_DestroyWindowsGraphics(){
SelectObject( This.hdc , This.obm )
DeleteObject( This.hbm )
DeleteDC( This.hdc )
}
_CreateWindowGraphics(){
This.hbm := CreateDIBSection( This.W , This.H )
This.hdc := CreateCompatibleDC()
This.obm := SelectObject( This.hdc , This.hbm )
This.G := Gdip_GraphicsFromHDC( This.hdc )
Gdip_SetSmoothingMode( This.G , This.Smoothing )
}
ShowWindow( Title := "" ){
Gui , % This.Hwnd ":Show", % "x" This.X " y" This.Y " w" This.W " h" This.H " NA", % Title
}
HideWindow(){
Gui , % This.Hwnd ":Hide",
}
UpdateWindow(){
UpdateLayeredWindow( This.hwnd , This.hdc , This.X , This.Y , This.W , This.H )
}
ClearWindow( AutoUpdate := 0 ){
Gdip_GraphicsClear( This.G )
if( Autoupdate )
This.UpdateWindow()
}
DrawBitmap( pBitmap , obj , dispose := 1 , AutoUpdate := 0 ){
Gdip_DrawImage( This.G , pBitmap , obj.X , obj.Y , obj.W , obj.H )
if( dispose )
Gdip_DisposeImage( pBitmap )
if( Autoupdate )
This.UpdateWindow()
}
PaintBackground( color := "0xFF000000" , AutoUpdate := 0 ){
if( isObject( color ) ){
Brush := Gdip_BrushCreateSolid( ( color.HasKey( "Color" ) ) ? ( color.Color ) : ( "0xFF000000" ) )
if( color.Haskey( "Round" ) )
Gdip_FillRoundedRectangle( This.G , Brush , color.X , color.Y , color.W , color.H , color.Round )
else
Gdip_FillRectangle( This.G , Brush , color.X , color.Y , color.W , color.H )
}else{
Brush := Gdip_BrushCreateSolid( color )
Gdip_FillRectangle( This.G , Brush , -1 , -1 , This.W + 2 , This.H + 2 )
}
Gdip_DeleteBrush( Brush )
if( AutoUpdate )
This.UpdateWindow()
}
DeleteWindow( GDIPShutdown := 0 ){
Gui, % This.Hwnd ":Destroy"
SelectObject( This.hdc , This.obm )
DeleteObject( This.hbm )
DeleteDC( This.hdc )
Gdip_DeleteGraphics( This.G )
hwnd := This.Hwnd
for k, v in PopUpWindow.Windows[ Hwnd ]
This[k] := ""
PopUpWindow.Windows[ Hwnd ] := ""
if( GDIPShutdown ){
Gdip_Shutdown( PopUpWindow.pToken )
PopUpWindow.pToken := ""
}
}
_OnClose( wParam ){
if( wParam = 0xF060 ){ ;SC_CLOSE ;[ clicking on the gui close button ]
Try{
Gui, % PopUpWindow.HelperHwnd ":Destroy"
SoundBeep, 555
}
}
}
CreateCachedBitmap( pBitmap , Dispose := 0 ){
local pCachedBitmap
if( This.CachedBitmap )
This.DisposeCachedbitmap()
DllCall( "gdiplus\GdipCreateCachedBitmap" , "Ptr" , pBitmap , "Ptr" , this.G , "PtrP" , pCachedBitmap )
This.CachedBitmap := pCachedBitmap
if( Dispose )
Gdip_DisposeImage( pBitmap )
}
DrawCachedBitmap( AutoUpdate := 0 ){
DllCall( "gdiplus\GdipDrawCachedBitmap" , "Ptr" , this.G , "Ptr" , This.CachedBitmap , "Int" , 0 , "Int" , 0 )
if( AutoUpdate )
This.UpdateWindow()
}
DisposeCachedbitmap(){
DllCall( "gdiplus\GdipDeleteCachedBitmap" , "Ptr" , This.CachedBitmap )
}
Helper(){
local hwnd , MethodList := ["__New","UpdateSettings","ShowWindow","HideWindow","UpdateWindow","ClearWindow","DrawBitmap","PaintBackground","DeleteWindow" , "AddTrigger" , "DrawTriggers", "CreateCachedBitmap" , "DrawCachedBitmap" , "DisposeCachedbitmap" ]
Gui, New, +AlwaysOnTop +ToolWindow +HwndHwnd
PopUpWindow.HelperHwnd := hwnd
Gui, Add, Edit, xm ym w250 r1 Center hwndhwnd, Gui1
PopUpWindow.EditHwnd := hwnd
loop, % MethodList.Length()
Gui, Add, Button, xm y+1 w250 r1 gPopUpWindow._HelperClip, % MethodList[ A_Index ]
Gui, Show,,
OnMessage( 0x112 , This._OnClose.Bind( hwnd ) )
}
_HelperClip(){
local ClipList
GuiControlGet, out, % PopUpWindow.HelperHwnd ":", % PopUpWindow.EditHwnd
ClipList := { __New: " := New PopUpWindow( { X: 0 , Y: 0 , W: A_ScreenWidth , H: A_ScreenHeight , Options: "" -DPIScale +AlwaysOnTop "" } )"
, UpdateSettings: ".UpdateSettings( { X: """" , Y: """" , W: """" , H: """" } , UpdateGraphics := 0 )"
, ShowWindow: ".ShowWindow( Title := """" )"
, HideWindow: ".HideWindow()"
, UpdateWindow: ".UpdateWindow()"
, ClearWindow: ".ClearWindow( AutoUpdate := 0 )"
, DrawBitmap: ".DrawBitmap( pBitmap := """" , { X: 0 , Y: 0 , W: " Out ".W , H: " Out ".H } , dispose := 1 )"
, PaintBackground: ".PaintBackground( color := ""0xFF000000"" ) " ";{ Color: ""0xFF000000"" , X: 2 , Y: 2 , W: " Out ".W - 4 , H: " Out ".H - 4 , Round: 10 }"
, DeleteWindow: ".DeleteWindow( GDIPShutdown := 0 )"
, AddTrigger: ".AddTrigger( { X: """" , Y: """" , W: """" , H: """" , Value: """" , Label: """" , BoundClass: """" , BoundMethod: """" } )"
, DrawTriggers: ".DrawTriggers( color := ""0xFFFF0000"" , AutoUpdate := 0 )"
, CreateCachedBitmap: ".CreateCachedBitmap( pBitmap , Dispose := 0 )"
, DrawCachedBitmap: ".DrawCachedBitmap( AutoUpdate := 0 )"
, DisposeCachedbitmap: ".DisposeCachedbitmap()" }
clipboard := Out ClipList[ A_GuiControl ]
}
}
Re: Cursor Highlighter
@Hellbent
Nice, thanks for the script!
Nice, thanks for the script!
Re: Cursor Highlighter
Could this be done by pausing the position update of the picture following the mouse?MouseTrap wrote: ↑17 Jan 2022, 05:55Sometimes I would like to have one or two movable arrow or hand picutures which are not following the mouse (as in this script) but can be moved with the mouse (click and move). Such that I can put it somewhere on the screen to highlight some aspects there while sharing the screen in a webmeeting.
So I could move my mouse to the desired place, press on pause and the picture stays there until I press pause again and the picture is following the mouse?
Re: Cursor Highlighter
@Hellbent, how can I get your altered GDIP lib? I have GDI+ lib by Tic.
Re: Cursor Highlighter
@Hellbent, I used this file in my user library: Gdip_All.ahk . Why did I get:
My script Is on the desktop.
My script Is on the desktop.
Re: Cursor Highlighter
@LAPIII, I don't see your image:
Spoiler
But maybe you need this:
Code: Select all
#Include, <Gdip_All>
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
Re: Cursor Highlighter
I can only say that this
Code: Select all
#Include <My Altered GDIP LIB>
Re: Cursor Highlighter
Instead of a halo around cursor, i just need a circle, can anybody please help me. am new to ahk
Re: Cursor Highlighter
What do you mean? You mean you want a circle for a cursor? Please explain!
Last edited by LAPIII on 26 Aug 2022, 15:45, edited 1 time in total.
Re: Cursor Highlighter
https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Red_circle.svg/2048px-Red_circle.svg.png
something like this
something like this
- Attachments
-
- image.png (154.48 KiB) Viewed 2804 times
Re: Cursor Highlighter
Code: Select all
Gui, 1:+AlwaysOnTop -Caption +LastFound -SysMenu +ToolWindow -DPIScale +E0x20
Gui, 1:Color, F0F0F0
Gui, 1:Font, s100 cYellow
Gui, 1:Add, Text, x20 y15,% CHR(0x25EF)
;Setting x and y of Unicode circle with full circle of Gui 2
Gui, 1:Show, w200 h200
WinSet, TransColor, F0F0F0
Re: Cursor Highlighter
Check here and watch the video.
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 179 guests