#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <Constants.au3>
#include <WinAPIEx.au3>
$proj = 'Рамка'
$width = 10
$sTime = 2000
HotKeySet('^{PGUP}', '_borderSizePlus')
HotKeySet('^{PGDN}', '_borderSizeMinus')
HotKeySet('{LEFT}', '_moveLeft')
HotKeySet('{UP}', '_moveUp')
HotKeySet('{RIGHT}', '_moveRight')
HotKeySet("{DOWN}", '_moveDown')
HotKeySet('^{LEFT}', '_sizeWidthPlus')
HotKeySet('^{UP}', '_sizeHeightMinus')
HotKeySet('^{RIGHT}', '_sizeWidthMinus')
HotKeySet("^{DOWN}", '_sizeHeightPlus')
HotKeySet("^{SPACE}", '_hide')
Opt('GUICloseOnESC', 0)
#region - GUI Create
$hGUI = GUICreate($proj, 300, 300, -1, -1, $WS_POPUPWINDOW, $WS_EX_LAYERED + $WS_EX_TOPMOST)
GUISetBkColor(0x0000F1)
$labelMenu = GUICtrlCreateLabel('', 0, 0, 300, 300, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor($labelMenu, 0x0000F1)
Dim $label[4] = [GUICtrlCreateLabel('', 0, 0, $width, 300), GUICtrlCreateLabel('', 0, 0, 300, $width), GUICtrlCreateLabel('', 300 - $width, 0, $width, 300), GUICtrlCreateLabel('', 0, 300 - $width, 300, $width)]
GUICtrlSetResizing($label[0], $GUI_DOCKLEFT + $GUI_DOCKWIDTH)
GUICtrlSetResizing($label[1], $GUI_DOCKTOP + $GUI_DOCKHEIGHT)
GUICtrlSetResizing($label[2], $GUI_DOCKRIGHT + $GUI_DOCKWIDTH)
GUICtrlSetResizing($label[3], $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)
$colorOld = 0x00FF00
For $i = 0 To 3
GUICtrlSetBkColor($label[$i], $colorOld)
GUICtrlSetStyle($label[$i], -1, $GUI_WS_EX_PARENTDRAG)
Next
_WinAPI_SetLayeredWindowAttributes($hGUI, 0x0000F1, 0, $LWA_COLORKEY)
GUISetState()
$wincoord = WinGetPos($proj)
$labelcoord = ControlGetPos($proj, '', 'Static1')
$border = ($wincoord[2] - $labelcoord[2]) / 2
$hTitle = $wincoord[3] - $labelcoord[3] - $border
#endregion - GUI Create
While 1
$msg = GUIGetMsg()
Select
Case $msg = -3
Exit
EndSelect
WEnd
Func _borderSizePlus()
$width += 1
If $width < 5 Then $width = 5
If $width > 60 Then $width = 60
$coord = WinGetPos($proj)
GUICtrlSetPos($label[0], 0, 0, $width, $coord[3])
GUICtrlSetPos($label[1], 0, 0, $coord[2], $width)
GUICtrlSetPos($label[2], $coord[2] - 2 * $border - $width, 0, $width, $coord[3])
GUICtrlSetPos($label[3], 0, $coord[3] - $hTitle - $border - $width, $coord[2], $width)
EndFunc ;==>_borderSizePlus
Func _borderSizeMinus()
$width -= 1
If $width < 5 Then $width = 5
If $width > 60 Then $width = 60
$coord = WinGetPos($proj)
GUICtrlSetPos($label[0], 0, 0, $width, $coord[3])
GUICtrlSetPos($label[1], 0, 0, $coord[2], $width)
GUICtrlSetPos($label[2], $coord[2] - 2 * $border - $width, 0, $width, $coord[3])
GUICtrlSetPos($label[3], 0, $coord[3] - $hTitle - $border - $width, $coord[2], $width)
EndFunc ;==>_borderSizeMinus
Func _hide($sTime = 2000)
GUISetState(@SW_HIDE)
Sleep($sTime)
GUISetState(@SW_SHOW)
EndFunc ;==>_hide
Func _moveLeft()
$coord = WinGetPos($proj)
WinMove($proj, '', $coord[0] - 1, $coord[1])
EndFunc ;==>_moveLeft
Func _moveRight()
$coord = WinGetPos($proj)
WinMove($proj, '', $coord[0] + 1, $coord[1])
EndFunc ;==>_moveRight
Func _moveUp()
$coord = WinGetPos($proj)
WinMove($proj, '', $coord[0], $coord[1] - 1)
EndFunc ;==>_moveUp
Func _moveDown()
$coord = WinGetPos($proj)
WinMove($proj, '', $coord[0], $coord[1] + 1)
EndFunc ;==>_moveDown
Func _sizeWidthMinus()
$coord = WinGetPos($proj)
WinMove($proj, '', $coord[0], $coord[1], $coord[2] + 1)
EndFunc ;==>_sizeWidthMinus
Func _sizeWidthPlus()
$coord = WinGetPos($proj)
WinMove($proj, '', $coord[0], $coord[1], $coord[2] - 1)
EndFunc ;==>_sizeWidthPlus
Func _sizeHeightMinus()
$coord = WinGetPos($proj)
WinMove($proj, '', $coord[0], $coord[1], $coord[2], $coord[3] - 1)
EndFunc ;==>_sizeHeightMinus
Func _sizeHeightPlus()
$coord = WinGetPos($proj)
WinMove($proj, '', $coord[0], $coord[1], $coord[2], $coord[3] + 1)
EndFunc ;==>_sizeHeightPlus