Achilles Posted June 18, 2007 Share Posted June 18, 2007 (edited) 88 87 104 is the background color for my desktop. I want to create a GUI with the same bkcolor, but it's not working. Here's an example: $yourBkColor = RegRead('HKEY_CURRENT_USER\Control Panel\Colors', 'Background') ConsoleWrite('! Your background color is: ' & $yourBkColor & @CRLF) GuiCreate('TESTING') GuiSetBkColor($yourBkColor) GuiSetState() Do Sleep(20) Until GuiGetMsg() = -3 Edit: This is what that autoit window info application says the bk color is: 5789544 Edited June 18, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 18, 2007 Share Posted June 18, 2007 How about: #include <GuiConstants.au3> $color = RegRead('HKEY_CURRENT_USER\Control Panel\Colors', 'Background') $avColor = StringSplit($color, " ") If $avColor[0] = 3 Then $color = ($avColor[1] * 256 * 256) + ($avColor[2] * 256) + $avColor[3] Opt("GuiOnEventMode", 1) GUICreate("Color: " & $color) GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit") GUISetBkColor($color) GUISetState() While 1 Sleep(20) WEnd Else MsgBox(16, "Error", "Error: Did not get valid color from registry.") EndIf Func _Quit() Exit EndFunc ;==>_Quit Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Achilles Posted June 18, 2007 Author Share Posted June 18, 2007 How about: #include <GuiConstants.au3> $color = RegRead('HKEY_CURRENT_USER\Control Panel\Colors', 'Background') $avColor = StringSplit($color, " ") If $avColor[0] = 3 Then $color = ($avColor[1] * 256 * 256) + ($avColor[2] * 256) + $avColor[3] Opt("GuiOnEventMode", 1) GUICreate("Color: " & $color) GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit") GUISetBkColor($color) GUISetState() While 1 Sleep(20) WEnd Else MsgBox(16, "Error", "Error: Did not get valid color from registry.") EndIf Func _Quit() Exit EndFunc ;==>_Quit Yay! Thanks a ton for that! My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
BeardedBlunder Posted June 18, 2007 Share Posted June 18, 2007 need to convert the RGB values (decimal) to hex 88 = 58 87 = 57 104 = 68 then assemble them like this: 0x585768 to specify in your GUI Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 18, 2007 Share Posted June 18, 2007 need to convert the RGB values (decimal) to hex88 = 5887 = 57104 = 68then assemble them like this:0x585768to specify in your GUIYou've got the right idea, but it doesn't have to be done in Hex. The RGB color is a 24bit number that can be generated and worked with in binary, octal, decimal, or Hex. These are all valid ways to present the same number to us humans, the computer doesn't care which you use. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
BeardedBlunder Posted June 18, 2007 Share Posted June 18, 2007 i'd assumed from the example in help file showing 0x<8digitshex> and not mentioning any other notations, that auotit GUIs needed that notation, it's going to make my own life easier if i can use RGB values in decimal. Link to comment Share on other sites More sharing options...
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