JohnnyThrash Posted March 7, 2010 Posted March 7, 2010 I frankly don't know where to start. I've done some searching on google, msdn, and here, but I don't really know what to look for or if it exists. Vista users are probably familiar with the feature of being able to change the color of vista's "glass". I don't want to use automation, that would be my last resort. Is there a dll in windows containing a function to change vista's glass color? I figured it would be relating to the DWM, so i had search that on MSDN as well with no luck. Anybody have any clues?
JRowe Posted March 7, 2010 Posted March 7, 2010 These are not the droids functions you're looking for.http://stackoverflow.com/questions/1487919/how-does-windows-change-aero-glass-color [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center]
Richard Robertson Posted March 7, 2010 Posted March 7, 2010 The "Set" version isn't documented, so you have to make the assumption that Microsoft didn't intend it to be called and as such, may be changed at any time.
JohnnyThrash Posted March 8, 2010 Author Posted March 8, 2010 The "Set" version isn't documented, so you have to make the assumption that Microsoft didn't intend it to be called and as such, may be changed at any time.Thanks JRowe, but Richard Robertson has exactly my thoughts. This isn't very well documented, I'm a bit lost. I had begun to attempt it but there were too many unknown variables.
JRowe Posted March 8, 2010 Posted March 8, 2010 (edited) This is the function I found DwmpSetColorization(ByVal ColorizationColor As UInt32, ByVal ColorizationOpaqueBlend As Boolean, ByVal Opacity As UInt32) Something like this should work. $hDll = DllOpen("dwmapi.dll") ; wherever / whatever the right dll is I don't know. You'll have to find it and set it. $iColorNumber = 123456 ; I have no clue how the color number is formatted as an integer $bColorizationOpaqueBlend = 1; 1 on, 0 off? $iOpacity = 128 ;Probably between 1 and 255 DllCall($hDll, "none", "DwmpSetColorization", "int", $iColorNumber, "int", $bColorizationOpaqueBlend, "int", $iOpacity) And like RichardRobertson said, it's not a documented function, so may disappear at any time. The parameters for GetColorization should give you a handle on how to correctly set the parameters for this function. And if it doesn't work, then it's probably already disappeared, and this really isn't the function you're looking for. Also, change none to "none:cdecl" if it requires that, I'm not sure. Good luck. Edited March 8, 2010 by JRowe [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center]
JRowe Posted March 8, 2010 Posted March 8, 2010 I'm not seeing the function in the dll, in c:/Windows/System32 . http://msdn.microsoft.com/en-us/library/aa969527%28VS.85%29.aspx Obviously it's possible, using the aero settings I can change the color in realtime. A quick hack would be to invisibly open the personalization manager and manipulating the controls. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center]
ProgAndy Posted March 8, 2010 Posted March 8, 2010 (edited) pinvoke states the function DwmpSetColorization is at EntryPoint #104. So try to use this instead of the name:DLLCall("dwmapi.dll", 'int', 104, "int", $iColorNumber, "int", $bColorizationOpaqueBlend, "int", $iOpacity) Edited March 8, 2010 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
JRowe Posted March 8, 2010 Posted March 8, 2010 That seems to work. I'm not going to play with it much, but this seems to function. $hDll = DllOpen("c:/Windows/System32/dwmapi.dll") $iColorNumber = 10 ; I have no clue how the color number is formatted $bColorizationOpaqueBlend = 0; 1 on, 0 off? Mr. Miyagi wax time - 0101. $iOpacity = 0 ;Probably between 1 and 255 DllCall($hDll, "none", 104, "int", $iColorNumber, "int", $bColorizationOpaqueBlend, "int", $iOpacity) ConsoleWrite("Error:" & @error & @CRLF) [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center]
Richard Robertson Posted March 8, 2010 Posted March 8, 2010 (edited) The color number is 0xAARRGGBB format and the opacity parameter is a 0 or 1 for opaque or not. I assume this based on the documentation for http://msdn.microsoft.com/en-us/library/aa969513%28VS.85%29.aspx Edited March 8, 2010 by Richard Robertson
JohnnyThrash Posted March 9, 2010 Author Posted March 9, 2010 (edited) That seems to work. I'm not going to play with it much, but this seems to function. $hDll = DllOpen("c:/Windows/System32/dwmapi.dll") $iColorNumber = 10 ; I have no clue how the color number is formatted $bColorizationOpaqueBlend = 0; 1 on, 0 off? Mr. Miyagi wax time - 0101. $iOpacity = 0 ;Probably between 1 and 255 DllCall($hDll, "none", 104, "int", $iColorNumber, "int", $bColorizationOpaqueBlend, "int", $iOpacity) ConsoleWrite("Error:" & @error & @CRLF) This is great, works like magic. The best part about this find is that I could not find any good information out there on google, but you nailed it man. The Code Below works great for changing the color to black $hDll = DllOpen(@WindowsDir&"/System32/dwmapi.dll") $iColorNumber = 3640655872 ; I retrieved this number from the registry. Makes the color black. $bColorizationOpaqueBlend = 0; Glass or Solid. $iOpacity = 50 ;No Idea? DllCall($hDll, "none", 104, "int", $iColorNumber, "int", $bColorizationOpaqueBlend, "int", $iOpacity) NOTE: I also tried this with other colors such as red, still works great. ALSO: Can anybody confirm this works in Windows 7? Edited March 9, 2010 by JohnnyThrash
Tvern Posted March 9, 2010 Posted March 9, 2010 Doesn't seem to. I guess the function has a different entrypoint.
JRowe Posted March 9, 2010 Posted March 9, 2010 Doesn't work in Win7, which is what I got. Glad it worked for you, though. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center]
Richard Robertson Posted March 9, 2010 Posted March 9, 2010 That number for black that you used equals 0xD9000000 in hex. This means it's actually a semitransparent black.
JohnnyThrash Posted March 10, 2010 Author Posted March 10, 2010 Doesn't work in Win7, which is what I got. Glad it worked for you, though. That's a damned shame. Not much use it won't work on the latest operating system.By the way, Richard, What then is the hex code for a solid black? And how can I convert that number into a regular decimal?
ProgAndy Posted March 10, 2010 Posted March 10, 2010 (edited) I found a DLLCall for Win7 http://social.msdn.microsoft.com/Forums/de-DE/windows7de/thread/ad570e44-a221-484d-836e-6e3c146080c0 (description only german) Edit: Found an english source: http://stackoverflow.com/questions/1487919/how-does-windows-change-aero-glass-color Edited March 10, 2010 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Richard Robertson Posted March 10, 2010 Posted March 10, 2010 You can use the hex directly. It's a little easier to read when it comes to colors. 0xFF000000 = solid black, because the alpha byte is set to 0xFF (255).
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