Что нового

Полупрозрачная область окна

Sergey2210

Осваивающий
Сообщения
263
Репутация
31
Версия AutoIt:3.

Описание:Как сделать определённую область окна полупрозрачной?

Пример с прозрачной областью:ПРЯМОУГОЛЬНИК
Код:
#include <GUIConstants.au3>

$gui = GUICreate("GUI", 500, 500)

_GUICreateInvRect($gui, 20, 150, 20, 200)

GUISetState()

While 1
  If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
  Sleep(10)
Wend

Func _GUICreateInvRect($hwnd, $l, $t, $w, $h)
  $pos = WinGetPos($hwnd)

  $1 = 4
  $2 = 4
  $3 = $pos[2]
  $4 = $t
  $ret = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
  $1 = 4
  $2 = 0
  $3 = $l
  $4 = $pos[3]
  $ret2 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
  $1 = $l + $w
  $2 = 4
  $3 = $pos[2]
  $4 = $pos[3]
  $ret3 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
  $1 = 4
  $2 = $t + $h
  $3 = $pos[2]
  $4 = $pos[3]
  $ret4 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)

  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret2[0], "int", 2)
  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret3[0], "int", 2)
  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret4[0], "int", 2)

  DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hwnd, "long", $ret[0], "int", 1)
EndFunc


Пример с прозрачной областью:КРУГ
Код:
#include <GuiConstants.au3>

$my_gui = GUICreate("MyGUI", 392, 323)

_GuiHole($my_gui, 0, 0, 100)
GUISetState()
While 1
   $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case Else
        ;;;
   EndSelect
WEnd
Exit

Func _GuiHole($h_win, $i_x, $i_y, $i_size)
   Dim $pos, $outer_rgn, $inner_rgn, $wh, $combined_rgn, $ret
   $pos = WinGetPos($h_win)
   
   $outer_rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", $pos[2], "long", $pos[3])
    If IsArray($outer_rgn) Then
        $inner_rgn = DllCall("gdi32.dll", "long", "CreateEllipticRgn", "long", $i_x, "long", $i_y, "long", $i_x + $i_size, "long", $i_y + $i_size)
        If IsArray($inner_rgn) Then
            $combined_rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0)
            If IsArray($combined_rgn) Then
                DllCall("gdi32.dll", "long", "CombineRgn", "long", $combined_rgn[0], "long", $outer_rgn[0], "long", $inner_rgn[0], "int", 4)
                $ret = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $combined_rgn[0], "int", 9)
                If $ret[0] Then
                    Return 1
                Else
                    Return 0
                EndIf
            Else
                Return 0
            EndIf
        Else
            Return 0
        EndIf
    Else
        Return 0
    EndIf
   
EndFunc  ;==>_GuiHole
 

Belfigor

Модератор
Локальный модератор
Сообщения
3 595
Репутация
938
Полезная штука
Вопрос только встает в полупрозрачности. У меня области прозрачны полностью. А как задать прозрачность в диапазоне от 0% до 100?
 
Автор
S

Sergey2210

Осваивающий
Сообщения
263
Репутация
31
Так вот сам не знаю,думаю что кно нибудь поможет... :smile:
 
Автор
S

Sergey2210

Осваивающий
Сообщения
263
Репутация
31
Вот ещё один скрипт:

Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

$hForm = GUICreate('', 400, 300)
_GUITrans($hForm, 30, 40, 90, 30)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop            
    EndSelect
WEnd

Func _GUITrans($hWnd, $x, $y, $sizew, $sizeh)
    Local $rgn1, $rgn2, $rgn3
    $pos = WinGetPos($hWnd)
    Global $width = $pos[2]
    Global $height = $pos[3]
    $rgn1 = _WinAPI_CreateRectRgn(0, 0, $width, $height)
    $rgn2 = _WinAPI_CreateRectRgn($x, $y, $x + $sizew, $y + $sizeh)
    $rgn3 = _WinAPI_CreateRectRgn(0, 0, 0, 0)
	DllCall("gdi32.dll", "int", "CombineRgn", "handle", $rgn3, "handle", $rgn1, "handle", $rgn2, "int", 3)
    _WinAPI_DeleteObject($rgn1)
    _WinAPI_DeleteObject($rgn2)
    _WinAPI_SetWindowRgn($hWnd, $rgn3)
EndFunc
 

VladUs

Скриптер
Сообщения
621
Репутация
180
А зачем было изобретать велосипед еще раз ?
Может просто надо было взглянуть на функцию _WinAPI_SetWindowRgn ().
И я думаю, о полупрозрачности здесь не может быть речи т.к эта функция, которую Вы вызываете через DllCall, отсекает прямоугольник по заданным параметрам в том числе и внутри формы. Таким образом можно создавать формы различной геометрии (квадратную, круглую, овальную и т.п.). Посмотрите примеры к вышеупомянутой функции.
 
Автор
S

Sergey2210

Осваивающий
Сообщения
263
Репутация
31
Я не говорю что сдесь можно сделать область полупрозрачной,я спрашиваю как это сделать,если нужно чтото убрать - уберу,чтото добавить - добавлю...
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5 379
Репутация
2 712
Делаешь два окна, одно над другим. Нижнее полупрозрачное, верхнее с дыркой. Вот и все.

Код:
#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>

$my_gui2 = GUICreate("MyGUI", 392, 323)
WinSetTrans($my_gui2, '', 128)
DllCall('uxtheme.dll', 'uint', 'SetWindowTheme', 'hwnd', $my_gui2, 'ptr', 0, 'wstr', '')
$my_gui = GUICreate("MyGUI", 392, 323, -1, -1, -1, -1, $my_gui2)
_GuiHole($my_gui, 0, 0, 100)
GUIRegisterMsg($WM_MOVE, 'WM_MOVE')
GUISetState(@SW_SHOW, $my_gui2)
GUISetState(@SW_SHOW, $my_gui)

While 1
	$msg = GUIGetMsg()
	Select
		Case $msg = $GUI_EVENT_CLOSE
			ExitLoop
		Case Else
			;;;
	EndSelect
WEnd
Exit

Func _GuiHole($h_win, $i_x, $i_y, $i_size)
	Dim $pos, $outer_rgn, $inner_rgn, $wh, $combined_rgn, $ret
	$pos = WinGetPos($h_win)

	$outer_rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", $pos[2], "long", $pos[3])
	If IsArray($outer_rgn) Then
		$inner_rgn = DllCall("gdi32.dll", "long", "CreateEllipticRgn", "long", $i_x, "long", $i_y, "long", $i_x + $i_size, "long", $i_y + $i_size)
		If IsArray($inner_rgn) Then
			$combined_rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0)
			If IsArray($combined_rgn) Then
				DllCall("gdi32.dll", "long", "CombineRgn", "long", $combined_rgn[0], "long", $outer_rgn[0], "long", $inner_rgn[0], "int", 4)
				$ret = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $combined_rgn[0], "int", 9)
				If $ret[0] Then
					Return 1
				Else
					Return 0
				EndIf
			Else
				Return 0
			EndIf
		Else
			Return 0
		EndIf
	Else
		Return 0
	EndIf
EndFunc   ;==>_GuiHole

Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
	Switch $hWnd
		Case $my_gui
			Local $Pos = WinGetPos($my_gui)
			If IsArray($Pos) Then
				WinMove($my_gui2, '', $Pos[0], $Pos[1], $Pos[2], $Pos[3])
			EndIf
	EndSwitch
	Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_MOVE
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5 379
Репутация
2 712
Sergey2210 сказал(а):
Вот ещё один скрипт.
А вот еще.

Код:
#Include <GUIConstantsEx.au3>
#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $hForm, $Button, $hRgn

Dim $aPoint[10][2] = [[0, 180], [190, 180], [250, 0], [308, 180], [500, 180], [344, 294], [404, 475], [250, 362], [94, 475], [154, 294]]

$hForm = GUICreate('MyGUI', 500, 475, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
$Button = GUICtrlCreateButton('Exit', 215, 255, 70, 23)
GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST')
GUISetBkColor(0xAA0000)

$hRgn = _WinAPI_CreatePolygonRgn($aPoint)
_WinAPI_SetWindowRgn($hForm, $hRgn)

GUISetState()

Do
Until GUIGetMsg() = $Button

Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam)
	If _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) = $HTCLIENT Then
		Return $HTCAPTION
	EndIf
	Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NCHITTEST
 
Автор
S

Sergey2210

Осваивающий
Сообщения
263
Репутация
31
Всё,проблема решена,спасибо... :smile:
 
Автор
S

Sergey2210

Осваивающий
Сообщения
263
Репутация
31
Вот что получилось:
Код:
#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>
#Include <WinAPI.au3>

$hForm2 = GUICreate("MyGUI", 400, 300, -1, -1, $WS_POPUP)
GUISetBkColor(0x02A0FC)
WinSetTrans($hForm2, '', 128)
DllCall('uxtheme.dll', 'uint', 'SetWindowTheme', 'hwnd', $hForm2, 'ptr', 0, 'wstr', '')
_Corners($hForm2,0,0,11,11)
GUICtrlCreateLabel('',0,0,400, 25,-1,$GUI_WS_EX_PARENTDRAG)
$hForm = GUICreate("MyGUI", 400, 300, -1, -1, $WS_POPUP, -1, $hForm2)
$PosGUI = WinGetPos($hForm)
_GUICreateInvRect($hForm, 8, 30, 393, 293)
$close = GUICtrlCreateButton("Выход",20,40,80,25)
GUIRegisterMsg($WM_MOVE, 'WM_MOVE')
GUISetState(@SW_SHOW, $hForm2)
GUISetState(@SW_SHOW, $hForm)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
		Case $msg = $close
            Exit			
    EndSelect
WEnd
Exit

Func _Corners($hWnd,$x1,$y1,$x2,$y2)	
$pos = WinGetPos($hWnd)
$ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $x1, "long", $y1, "long", $pos[2], "long", $pos[2], "long",$x2, "long", $y2)
If $ret[0] Then
	$ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $ret[0], "int", 1)
	If $ret2[0] Then
		Return 1
	Else
		Return 0
	EndIf	
EndIf
EndFunc

Func _GUICreateInvRect($hwnd, $l, $t, $w, $h)
  $ret  = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $l, "long", $t, "long", $w, "long", $h)
  $ret2 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $l, "long", $t, "long", $w, "long", $h)
  $ret3 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $l, "long", $t, "long", $w, "long", $h)
  $ret4 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $l, "long", $t, "long", $w, "long", $h))
  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret2[0], "int", 2)
  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret3[0], "int", 2)
  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret4[0], "int", 2)
  $5 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hwnd, "long", $ret[0], "int", 1)
EndFunc

Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
    Switch $hWnd
        Case $hForm2
            Local $Pos = WinGetPos($hForm2)
            If IsArray($Pos) Then
                WinMove($hForm, '', $Pos[0], $Pos[1], $Pos[2], $Pos[3])
            EndIf
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc
 
Автор
S

Sergey2210

Осваивающий
Сообщения
263
Репутация
31
Или вот скиновое:
Код:
#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>
#Include <WinAPI.au3>
#include <Color.au3>

$hForm2 = GUICreate("MyGUI", 400, 300, -1, -1, $WS_POPUP)
WinSetTrans($hForm2, '', 128)
DllCall('uxtheme.dll', 'uint', 'SetWindowTheme', 'hwnd', $hForm2, 'ptr', 0, 'wstr', '')
_Corners($hForm2,0,0,11,11)
GUICreateVSkin($hForm2)
$hForm = GUICreate("MyGUI", 400, 300, -1, -1, $WS_POPUP, -1, $hForm2)
$PosGUI = WinGetPos($hForm)
_GUICreateInvRect($hForm, 5, 24, 394, 295)
GUICreateVSkin_Gradient($hForm, 0x303030, 0xC0C0C0)
GUICreateVSkin_Gradient($hForm2, 0x303030, 0xC0C0C0)
$close = GUICtrlCreateButton("Выход",20,40,80,25)
GUIRegisterMsg($WM_MOVE, 'WM_MOVE')
GUISetState(@SW_SHOW, $hForm2)
GUISetState(@SW_SHOW, $hForm)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
		Case $msg = $close
            Exit			
    EndSelect
WEnd
Exit

Func _Corners($hWnd,$x1,$y1,$x2,$y2)	
$pos = WinGetPos($hWnd)
$ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $x1, "long", $y1, "long", $pos[2], "long", $pos[2], "long",$x2, "long", $y2)
If $ret[0] Then
	$ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $ret[0], "int", 1)
	If $ret2[0] Then
		Return 1
	Else
		Return 0
	EndIf	
EndIf
EndFunc

Func _GUICreateInvRect($hwnd, $l, $t, $w, $h)
  $ret  = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $l, "long", $t, "long", $w, "long", $h)
  $ret2 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $l, "long", $t, "long", $w, "long", $h)
  $ret3 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $l, "long", $t, "long", $w, "long", $h)
  $ret4 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $l, "long", $t, "long", $w, "long", $h)
  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret2[0], "int", 2)
  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret3[0], "int", 2)
  DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret4[0], "int", 2)
  $5 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hwnd, "long", $ret[0], "int", 1)
EndFunc

Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
    Switch $hWnd
        Case $hForm2
            Local $Pos = WinGetPos($hForm2)
            If IsArray($Pos) Then
                WinMove($hForm, '', $Pos[0], $Pos[1], $Pos[2], $Pos[3])
            EndIf
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc

Func GUICreateVSkin($hWnd)	
$hPos = WinGetPos($hWnd)
GUICtrlCreateLabel('',0,0,$hPos[2]-77,24,$WS_CLIPSIBLINGS, $GUI_WS_EX_PARENTDRAG)
GUICtrlCreateLabel("",0,0,$hPos[2],24)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0xCCCCCC)
; Left corners
GUICtrlCreateLabel('',0,1,6,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
GUICtrlCreateLabel('',0,2,4,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
GUICtrlCreateLabel('',0,3,3,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
GUICtrlCreateLabel('',0,4,2,3)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
GUICtrlCreateLabel('',0,5,1,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
; Right corners
GUICtrlCreateLabel('',$hPos[2]-7,1,6,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
GUICtrlCreateLabel('',$hPos[2]-5,2,4,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
GUICtrlCreateLabel('',$hPos[2]-4,3,3,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
GUICtrlCreateLabel('',$hPos[2]-3,4,2,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
GUICtrlCreateLabel('',$hPos[2]-2,5,1,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x353535)
; Top
GUICtrlCreateLabel('',0,0,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',6,1,$hPos[2]-18,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0xCCCCCC)
GUICtrlCreateLabel('',6,2,$hPos[2]-13,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x727272)
GUICtrlCreateLabel('',4,3,$hPos[2]-9,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x727272)
GUICtrlCreateLabel('',3,4,$hPos[2]-7,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x727272)
GUICtrlCreateLabel('',3,5,$hPos[2]-7,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x727272)
GUICtrlCreateLabel('',3,6,$hPos[2]-6,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x727272)
GUICtrlCreateLabel('',2,7,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x727272)
GUICtrlCreateLabel('',0,8,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x727272)
GUICtrlCreateLabel('',0,9,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',0,10,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',0,11,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',0,12,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',0,13,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',0,14,$hPos[2],1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel("",0,15,$hPos[2],9)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
; Left 
GUICtrlCreateLabel('',0,0,1,$hPos[3])
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',1,7,1,$hPos[3]-1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0xBCBCBC)
GUICtrlCreateLabel('',2,14,1,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x333333)
GUICtrlCreateLabel('',2,16,1,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x444444)
GUICtrlCreateLabel('',2,18,1,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x494949)
GUICtrlCreateLabel('',2,20,1,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x515151)
GUICtrlCreateLabel('',2,22,1,$hPos[3]-20)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x5B5B5B)
GUICtrlCreateLabel('',3,24,1,$hPos[3]-23)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',4,24,1,$hPos[3]-23)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
; Right 
GUICtrlCreateLabel('',$hPos[2]-2,0,1,$hPos[3])
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',$hPos[2]-3,7,1,$hPos[3]-7)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0xBCBCBC)
GUICtrlCreateLabel('',$hPos[2]-4,14,1,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x333333)
GUICtrlCreateLabel('',$hPos[2]-4,16,1,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x444444)
GUICtrlCreateLabel('',$hPos[2]-4,18,1,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x494949)
GUICtrlCreateLabel('',$hPos[2]-4,20,1,2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x515151)
GUICtrlCreateLabel('',$hPos[2]-4,22,1,$hPos[3]-22)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x5B5B5B)
GUICtrlCreateLabel('',$hPos[2]-5,24,1,$hPos[3]-22)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',$hPos[2]-6,24,1,$hPos[3]-22)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
; Bottom 
GUICtrlCreateLabel('',0,$hPos[3]-1,$hPos[2],2)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',1,$hPos[3]-2,$hPos[2]-3,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0xBCBCBC)
GUICtrlCreateLabel('',1,$hPos[3]-3,$hPos[2]-3,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x5B5B5B)
GUICtrlCreateLabel('',5,$hPos[3]-4,$hPos[2]-9,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
GUICtrlCreateLabel('',5,$hPos[3]-5,$hPos[2]-9,1)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetBkColor(-1,0x000000)
EndFunc

Func GUICreateVSkin_Gradient($hWnd, $hStartColor, $hEndColor)
    Local $nSize = WinGetClientSize($hWnd)
    Local $nX=0, $nY=0, $nWidth=$nSize[0], $nHeight=$nSize[1]
    Local $color1R = _ColorGetRed($hStartColor)
    Local $color1G = _ColorGetGreen($hStartColor)
    Local $color1B = _ColorGetBlue($hStartColor)
    Local $nStepR = (_ColorGetRed($hEndColor) - $color1R) / $nHeight
    Local $nStepG = (_ColorGetGreen($hEndColor) - $color1G) / $nHeight
    Local $nStepB = (_ColorGetBlue($hEndColor) - $color1B) / $nHeight
    $nGraph = GuiCtrlCreateGraphic($nX, $nY, $nWidth, $nHeight)
    For $i = 0 To $nHeight - $nY
        $sColor = "0x" & StringFormat("%02X%02X%02X", $color1R+$nStepR*$i, $color1G+$nStepG*$i, $color1B+$nStepB*$i)
        GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0x000000)
        GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
        GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nWidth, $i)
    Next
    GUICtrlSetState( $nGraph, $GUI_DISABLE)
    Return $nGraph
EndFunc
 
Верх