Code: Select all
#SingleInstance Force
X_OFFSET := 0
Y_OFFSET := 0
hCircle := makeCircle(0x00FF00, r := 55, 2, 240)
hCircle2 := makeCircle2(0x00FF00, r := 25, 2, 240)
hCircle3 := makeCircle3(0xFF0000, r := 2, 1, 240)
msgbox , Verschiebe einfach irgent wo hin , beim schließen des fensters verschwindet auch das Fadenkreuz
ExitApp
makeCircle(color, r := 50, thickness := 10, transparency := 254) {
static HWND := MakeGui()
d := 2 * r
; https://autohotkey.com/board/topic/7377-create-a-transparent-circle-in-window-w-winset-region/
outer := DllCall("CreateEllipticRgn", "Int", 0, "Int", 0, "Int", d, "Int", d)
inner := DllCall("CreateEllipticRgn", "Int", thickness, "Int", thickness, "Int", d - thickness, "Int", d - thickness)
DllCall("CombineRgn", "UInt", outer, "UInt", outer, "UInt", inner, "Int", 3) ; RGN_XOR = 3
DllCall("SetWindowRgn", "UInt", HWND, "UInt", outer, "UInt", true)
Gui %HWND%:Color, % color
Gui %HWND%:Show, xCenter yCenter w%d% h%d% NoActivate
WinSet Transparent, % transparency, % "ahk_id " HWND
return HWND
}
MakeGui() {
Gui New, +E0x20 +AlwaysOnTop +ToolWindow -Caption +Hwndhwnd
return hwnd
}
makeCircle2(color, r := 50, thickness := 10, transparency := 254) {
static HWND := MakeGui2()
d := 2 * r
; https://autohotkey.com/board/topic/7377-create-a-transparent-circle-in-window-w-winset-region/
outer := DllCall("CreateEllipticRgn", "Int", 0, "Int", 0, "Int", d, "Int", d)
inner := DllCall("CreateEllipticRgn", "Int", thickness, "Int", thickness, "Int", d - thickness, "Int", d - thickness)
DllCall("CombineRgn", "UInt", outer, "UInt", outer, "UInt", inner, "Int", 3) ; RGN_XOR = 3
DllCall("SetWindowRgn", "UInt", HWND, "UInt", outer, "UInt", true)
Gui %HWND%:Color, % color
Gui %HWND%:Show, xCenter yCenter w%d% h%d% NoActivate
WinSet Transparent, % transparency, % "ahk_id " HWND
return HWND
}
MakeGui2() {
Gui New, +E0x20 +AlwaysOnTop +ToolWindow -Caption +Hwndhwnd
return hwnd
}
makeCircle3(color, r := 50, thickness := 10, transparency := 254) {
static HWND := MakeGui2()
d := 2 * r
; https://autohotkey.com/board/topic/7377-create-a-transparent-circle-in-window-w-winset-region/
outer := DllCall("CreateEllipticRgn", "Int", 0, "Int", 0, "Int", d, "Int", d)
inner := DllCall("CreateEllipticRgn", "Int", thickness, "Int", thickness, "Int", d - thickness, "Int", d - thickness)
DllCall("CombineRgn", "UInt", outer, "UInt", outer, "UInt", inner, "Int", 3) ; RGN_XOR = 3
DllCall("SetWindowRgn", "UInt", HWND, "UInt", outer, "UInt", true)
Gui %HWND%:Color, % color
Gui %HWND%:Show, xCenter yCenter w%d% h%d% NoActivate
WinSet Transparent, % transparency, % "ahk_id " HWND
return HWND
}
MakeGui3() {
Gui New, +E0x20 +AlwaysOnTop +ToolWindow -Caption +Hwndhwnd
return hwnd
}
~END::ExitApp
guiclose:
ExitApp