; ---------------------------------------------------------------------------- global $hex Func Terminate() Exit 0 EndFunc ;==>Terminate TraySetToolTip("PixelSearch") Opt("TrayMenuMode", 1+2) $pipetkaitem = TrayCreateItem("Пипетка") $getpix = TrayCreateItem("GetPix") $exititem = TrayCreateItem("Exit") TraySetState(1) GETPIX() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $exititem Terminate() Case $msg = $getpix GETPIX() Case $msg = $pipetkaitem Pipetka() EndSelect WEnd Func Pipetka() $pos = MouseGetPos() $hex = Hex(PixelGetColor($pos[0], $pos[1])) ClipPut(StringRight($hex, 6)) GETPIX() EndFunc func GETPIX() $clip = ClipGet() If StringLen($clip) = 6 then $hex = $clip $hex = inputbox("Введиде HEX:", "HEX код цвета 6 знаков", $hex) If StringLen($hex) = 6 then $px = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, "0x" & $hex) IF NOT @ERROR THEN MouseMove($px[0], $px[1]) $txt = Hex(PixelGetColor($px[0], $px[1])) ;ClipPut ($px[0] & ", " & $px[1]) $msg = MsgBox(4, "Найден #1# " & $px[0] & ", " & $px[1], $hex & " = " & $txt & @LF & "Завершить?" ) if $msg = 7 then GETPIX2() Else MsgBox(0, "Не найден", $hex) EndIf Else MsgBox(0, "Выход", $hex) Endif EndFunc func GETPIX2() $px = PixelSearch(@DesktopWidth, @DesktopHeight, 0, 0, "0x" & $hex) IF NOT @ERROR THEN $txt = Hex(PixelGetColor($px[0], $px[1])) MouseMove($px[0], $px[1]) ;ClipPut ($px[0] & ", " & $px[1]) $msg = MsgBox(4, "Найден #2# " & $px[0] & ", " & $px[1], $hex & " = " & $txt & @LF & "Завершить?" ) if $msg = 7 then GETPIX3() EndIf EndFunc func GETPIX3() $px = PixelSearch(@DesktopWidth, 0, 0, @DesktopHeight, "0x" & $hex) IF NOT @ERROR THEN $txt = Hex(PixelGetColor($px[0], $px[1])) MouseMove($px[0], $px[1]) ; ($px[0] & ", " & $px[1]) $msg = MsgBox(4, "Найден #3# " & $px[0] & ", " & $px[1], $hex & " = " & $txt & @LF & "Завершить?" ) if $msg = 7 then GETPIX4() EndIf EndFunc func GETPIX4() $px = PixelSearch(0, @DesktopWidth, @DesktopHeight, 0, "0x" & $hex) IF NOT @ERROR THEN $txt = Hex(PixelGetColor($px[0], $px[1])) MouseMove($px[0], $px[1]) ;ClipPut ($px[0] & ", " & $px[1]) $msg = MsgBox(0, "Найден #4# " & $px[0] & ", " & $px[1], $hex & " = " & $txt & @LF & "Поиск окончен" ) EndIf EndFunc