Indeed, the code box is broken!
Here the code from that link:
;http://www.autoitscript.com/forum/index.php?showtopic=93706
;===============================================================================
;
; Function Name:
; _DrawTransparentEllipse
; Description:: Let you draw a transparent Ellipse
; Parameter(s):
; $hwnd - Handle of GUI to work on
; $x - Postion x of the Ellipse
; $y - Postion y of the Ellipse
; $w - Width of the Ellipse
; $h - Height of the Ellipse, If w=h it will be a circle.
; $Transparency - Set Transparancy of GUI ( optional )
; $EllipseBorderColor - A Border Color if you want =) ( optional )
; Requirement(s): Layered Windows
; Return Value(s): ControlID of the Form
; Author(s): Greek, martin
; Example : Yes
;===============================================================================
;===============================================================================
;
; Function Name:
; _DrawTransparentRect
; Description:: Let you draw a transparent Rect
; Parameter(s):
; $hwnd - Handle of GUI to work on
; $x - Postion x of the Rect
; $y - Postion y of the Rect
; $w - Width of the Rect
; $h - Height of the Rect, If w=h it will be a square.
; $Transparency - Set Transparancy of GUI ( optional )
; $RectBorderColor - A Border Color if you want =) ( optional )
; Requirement(s): Layered Windows
; Return Value(s): ControlID of the Form
; Author(s): Greek, martin
; Example : Yes
;===============================================================================
;===============================================================================
;
; Function Name: _DrawTransparentLine
; Description:: Let you draw a transparent Line
; Parameter(s):
; $hwnd - Handle of GUI to work on
; $x - Postion x of the Line
; $y - Postion x of the Line
; $length - Postion x of the Line
; $course - Postion x of the Line
; $pensize - The pensize, default is 2 ( optional )
; $Transparency - Set Transparancy of GUI ( optional )
; Requirement(s): Layered Windows
; Return Value(s): ControlID of the Form
; Author(s): Greek, martin
; Example : Yes
;===============================================================================
;===============================================================================
;
; Function Name: _DeletTransparentForm
; Description:: Delet the Form
; Parameter(s):
; $Form - controlID of the Form
; Return Value(s): Success: Returns 1.
; Failure: Returns 0.
; Author(s): Greek, martin
;===============================================================================
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$gui=GUICreate ( "Transparent Ellipse and Rect", 420, 500, @DesktopWidth/2-300, @DesktopHeight/2-300, $WS_POPUP, $WS_EX_LAYERED )
GUISetBkColor ( 0x000000 )
GUICtrlCreateLabel("", 0, 0, 420, 500, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState ()
_DrawTransparentLine ( $gui, 50, 400, 300, 0)
_DrawTransparentEllipse ( $gui, 20, 20, 150, 100 )
_DrawTransparentEllipse ( $gui, 250, 20, 150, 100, 255, 0xFF0000 )
_DrawTransparentRect ( $gui, 20, 200, 150, 150 )
_DrawTransparentRect ( $gui, 250, 200, 150, 150, 255, 0x0000FF )
While 1
$msg=GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _DeletTransparentForm ( $Form )
$a=GUICtrlDelete ( $Form )
Return $a
EndFunc
Func _DrawTransparentLine($hwnd, $X,$Y,$length,$course,$pensize=2,$Transparency=255)
_WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
$g1=GUICtrlCreateGraphic($X,$Y,0,0)
GUICtrlSetGraphic($g1, $GUI_GR_PENSIZE, $pensize )
GUICtrlSetGraphic($g1, $GUI_GR_COLOR,0xABCDEF, 0xABCDEF)
GUICtrlSetGraphic($g1, $GUI_GR_LINE, $length, $course)
GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
Return $g1
EndFunc
Func _DrawTransparentRect($hwnd, $x,$y,$w,$h,$Transparency=255, $RectBorderColor=0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
$g1=GUICtrlCreateGraphic(0,0,0,0)
GUICtrlSetGraphic($g1, $GUI_GR_COLOR,$RectBorderColor, 0xABCDEF)
GUICtrlSetGraphic($g1, $GUI_GR_RECT, $x, $y, $w, $h)
GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
Return $g1
EndFunc
Func _DrawTransparentEllipse($hwnd, $x,$y,$w,$h,$Transparency=255,$EllipseBorderColor=0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
$g1=GUICtrlCreateGraphic(0,0,0,0)
GUICtrlSetGraphic($g1, $GUI_GR_COLOR,$EllipseBorderColor, 0xABCDEF)
GUICtrlSetGraphic($g1, $GUI_GR_ELLIPSE, $x, $y, $w, $h)
GUICtrlSetGraphic($g1, $GUI_GR_REFRESH)
GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1)
Return $g1
EndFunc
Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
; progandy
If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
Select
Case @error
Return SetError(@error, 0, 0)
Case $Ret[0] = 0
Return SetError(4, _WinAPI_GetLastError(), 0)
Case Else
Return 1
EndSelect
EndFunc ;==>_WinAPI_SetLayeredWindowAttributes
Func _WinAPI_GetLastError()
Local $aResult
$aResult = DllCall("Kernel32.dll", "int", "GetLastError")
If @error Then Return SetError(@error, 0, 0)
Return $aResult[0]
EndFunc ;==>_WinAPI_GetLastError
Br,
UEZ