ChrisN Posted June 15, 2012 Posted June 15, 2012 How can I change aero glass color from my program? All I have found is this:[DllImport("dwmapi.dll", EntryPoint = "#127", PreserveSig = false)] public static extern void DwmGetColorizationParameters(out WDM_COLORIZATION_PARAMS parameters); [DllImport("dwmapi.dll", EntryPoint = "#131", PreserveSig = false)] public static extern void DwmSetColorizationParameters(WDM_COLORIZATION_PARAMS parameters, uint uUnknown); public struct WDM_COLORIZATION_PARAMS { public uint Color1; public uint Color2; public uint Intensity; public uint Unknown1; public uint Unknown2; public uint Unknown3; public uint Opaque; }source:http://stackoverflow.com/questions/1487919/how-does-windows-change-aero-glass-colorAnd I don't have a clue about using external dll's. Can anyone help?
Yashied Posted June 15, 2012 Posted June 15, 2012 LinkGlobal Const $tagCOLORIZATIONPARAMS = 'dword Color;dword AftGlow;uint Intensity;uint AftGlowBal;uint BlurBal;uint GlassReflInt uint Opaque' $tCP = DllStructCreate($tagCOLORIZATIONPARAMS) $Ret = DllCall('dwmapi.dll', 'uint', 'DwmGetColorizationParameters', 'ptr', DllStructGetPtr($tCP)) ;If (@error) Or ($Ret[0]) Then ; Error ;EndIf DllStructSetData($tCP, 'Color', ...) ; Set a new color $Ret = DllCall('dwmapi.dll', 'uint', 'DwmSetColorizationParameters', 'ptr', DllStructGetPtr($tCP), 'uint', 0) ;If (@error) Or ($Ret[0]) Then ; Error ;EndIf My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
ChrisN Posted June 15, 2012 Author Posted June 15, 2012 Sorry, it doesn't work. I get error 3 for both DllCall()'s
JFX Posted June 16, 2012 Posted June 16, 2012 You need to call these functions by ordinal 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)
ChrisN Posted June 16, 2012 Author Posted June 16, 2012 (edited) Awesome! Thanks @JFX It works! Edited June 16, 2012 by ChrisN
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now