logo       

Re: Right clicking the system tray: msg#00270

windows.autoit.user

Subject: Re: Right clicking the system tray

AutXtra has a function called GetPixelColor... here is an example of
how to use...

run autoit /reveal, click the desktop and note the mouse position
hovering over the taskbar... now create a loop to discover the
pixelcolors of your icon...

HideAutoItWin,on
SetBatchLines,150
SetEnv,Xpos,965
IfExist,test.txt,FileDelete,test.txt
Repeat,200
SetEnv,AutXtra,GetPixelColor
SetEnv,AutXtraData1,%Xpos%
SetEnv,AutXtraData2,753
RunWait,AutXtra *clipboard
FileAppend,%Xpos%\,765 = %clipboard%\n,test.txt
EnvSub,Xpos,1
EndRepeat
Run,notepad test.txt
Exit

I notice that my sound speaker in the tray has a number at a pixel
946,765 = 9927290

So I do this...

HideAutoItWin,on
SetBatchLines,150
SetEnv,Xpos,965
WinActivate,Program Manager
WinWaitActive,Program Manager
Loop:
SetEnv,AutXtra,GetPixelColor
SetEnv,AutXtraData1,%Xpos%
SetEnv,AutXtraData2,753
RunWait,AutXtra *clipboard
SetEnv,var,%clipboard%
IfEqual,var,9927290,Goto,RightClick
EnvSub,Xpos,1
IfLess,Xpos,765,Goto,Error
Goto,Loop

RightClick:
RightClick,%Xpos%,753
Exit

Error:
MsgBox,4096,Debug,Did not find icon!

ugly, but works...

Larry


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for the latest Free IT White Papers?
Visit SearchMobileComputing.com to access over 500 white papers.
Get instant access at SearchMobileComputing.com Today
http://us.click.yahoo.com/ZyjvfD/PLNGAA/uitMAA/EGnolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
AutoItList-unsubscribe@xxxxxxxxxxxxxxx



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise