Что нового

Установка цвета для Aero

musicstashall

Знающий
Сообщения
322
Репутация
7
Пытаюсь освоить функцию, никак не пойму, в каком формате нужный цвет записать. Что бы я ни написал, всегда устанавливается, почему-то, зеленый))

Код:
Global Const $tagCOLORIZATIONPARAMS = 'dword Color;dword AftGlow;uint Intensity;uint AftGlowBal;uint BlurBal;uint GlassReflInt; uint Opaque'

$tCP = DllStructCreate($tagCOLORIZATIONPARAMS)
;$Ret = DllCall('dwmapi.dll', 'uint', 127, 'ptr', DllStructGetPtr($tCP))

DllStructSetData($tCP, 'Color', 0x00FF00) ; Set a new color
DllStructSetData($tCP, 'Intensity', -1) ; Set a new Intensity
DllStructSetData($tCP, 'Opaque', 0) ; Set a new Opaque
$Ret = DllCall('dwmapi.dll', 'uint', 131, 'ptr', DllStructGetPtr($tCP), 'uint', 0)
$Color = "4ff0000"

$Ret = DllCall('dwmapi.dll', 'uint', 'DwmGetColorizationParameters', 'ptr', DllStructGetPtr($tCP))
;If (@error) Or ($Ret[0]) Then
;    Error
;EndIf
DllStructSetData($tCP, 'Color', $Color) ; Set a new color
$Ret = DllCall('dwmapi.dll', 'uint', 'DwmSetColorizationParameters', 'ptr', DllStructGetPtr($tCP), 'uint', 0)
;If (@error) Or ($Ret[0]) Then
;    Error
;EndIf
 
Автор
M

musicstashall

Знающий
Сообщения
322
Репутация
7
Уже разобрался
Код:
#include <WinAPIGdi.au3>
Global Const $tagCOLORIZATIONPARAMS = 'dword Color;dword AftGlow;uint Intensity;uint AftGlowBal;uint BlurBal;uint GlassReflInt; uint Opaque'

$tCP = DllStructCreate($tagCOLORIZATIONPARAMS)
$iColor = _ChooseColor()
$cr = Hex($iColor, 6)
$hColor = '0x' & StringMid($cr, 5, 2) & StringMid($cr, 3, 2) & StringMid($cr, 1, 2)
ConsoleWrite('Цвет: ' & $hColor & @CR)
DllStructSetData($tCP, 'Color', $hColor) ; Set a new color
;DllStructSetData($tCP, 'Intensity', -1) ; Set a new Intensity
;DllStructSetData($tCP, 'Opaque', 0) ; Set a new Opaque
;$Ret = DllCall('dwmapi.dll', 'uint', 127, 'ptr', DllStructGetPtr($tCP))
$Ret = DllCall('dwmapi.dll', 'uint', 131, 'ptr', DllStructGetPtr($tCP), 'uint', 0)
$Ret = DllCall('dwmapi.dll', 'uint', 'DwmGetColorizationParameters', 'ptr', DllStructGetPtr($tCP))

$iColor = _WinAPI_DwmGetColorizationColor() ; получить цвет
Local $iBlend = @extended
 
Верх