lod3n Posted October 23, 2006 Share Posted October 23, 2006 (edited) Someone's probably already posted something similar, but I thought this worth posting:#include <GUIConstants.au3> #include <Color.au3> #Include <Misc.au3> #include <String.au3> $gui = GUICreate ( "Get Color - Press ESC when ready", 200 , 50 , 100 , 100 ,$WS_CAPTION ,$WS_EX_TOOLWINDOW ) WinSetOnTop ($gui, "", 1) GUISetState(@SW_SHOW) $user32 = dllopen("user32.dll") while not _IsPressed("1B", $user32) sleep(100) $color = getmousecolor() GUISetBkColor ($color, $gui ) WEnd DllClose($user32) $r = hex(_ColorGetRed( $color),2) $g = hex(_ColorGetGreen( $color),2) $b = hex(_ColorGetBlue( $color),2) $hexcolor = "#"&$r&$g&$b clipput($hexcolor) WinActivate($gui) msgbox(0,"Get Color","Placed in clipboard: "&$hexcolor) func getmousecolor() $pos = MouseGetPos() return PixelGetColor ( $pos[0],$pos[1] ) EndFunc Edited October 23, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] 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