Mouse Get Pixel Color ..ใช้ Control Loop While
While, 1
{
MouseGetPos, MouseX, MouseY
PixelGetColor, Color, %MouseX%, %MouseY%
ToolTip, X=%MouseX%`nY=%MouseY%`nC=%Color%
Sleep, 10
}
return
Esc::
ExitApp
return
GuiClose:
ExitApp==========================================================================
หรือใช้คำสั่ง SetTimer แทน Control Loop ก็ได้
#Persistent
SetTimer, timer, 10
timer:
MouseGetPos, MouseX, MouseY
PixelGetColor, Color, %MouseX%, %MouseY%
ToolTip, X=%MouseX%`nY=%MouseY%`nC=%Color%
return
Esc::
ExitApp
return
GuiClose:
ExitApp==========================================================================
Desktop Wallpaper Changer
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
Gui, Add, Edit, x10 y31 w100 h20 +Center vMyEdit +ReadOnly
Gui, Add, Picture, x205 y30 w90 h60 +Border vMyPicture
Gui, Add, Text, x25 y11 w70 h15 +Center, Picture name
Gui, Add, Text, x210 y11 w70 h15 +Center, View Picture
Gui, Add, Button, x115 y30 w70 h20 , Browse
Gui, Add, Button, x25 y65 w70 h25 , Change
GuiControl, Disable, Change
Gui, Add, Button, x140 y70 w40 h20 , Defult
Gui, Show, w300 h94, DWC
return
ButtonBrowse:
FileSelectFile, FileVar, 3, , Open a file, Image (*.bmp)
if FileVar
SplitPath, FileVar, name
GuiControl,, MyEdit, %name%
GuiControl, Enable, Change
GuiControl,, Mypicture, %name%
return
ButtonChange:
DllCall("SystemParametersInfo", UInt, 0x14, UInt, 0, Str, FileVar, UInt, 2)
if not Error
GuiControl,, MyEdit
GuiControl, Disable, Change
return
ButtonDefult:
DllCall("SystemParametersInfo", UInt, 0x14, UInt, 0, int, 0, UInt, 2)
return
GuiClose:
ExitApp