ghostofdeath Posted August 14, 2008 Share Posted August 14, 2008 Here's my code, i think the $handle isnt working propely with pixelgetcolor variables expandcollapse popupHotKeySet("{DELETE}","start") HotKeySet("{INSERT}","pause") HotKeySet("{END}","end") $handle=WinGetHandle ("LinkCrews.com - Surf - Mozilla Firefox") Global $Paused Func end() Exit 0 EndFunc Func pause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func start() $dec=Dec("2F2C2C") $dec2=Dec("666666") Do $pixel=PixelGetColor(37,702,$handle) $pixel2=PixelGetColor(93,740,$handle) $pixel3=PixelGetColor(25,735,$handle) If $pixel=$dec Then ControlClick("LinkCrews.com - Surf - Mozilla Firefox", "", "[CLASS:MozillaWindowClass; INSTANCE:5]","left","2",444,47) sleep(3000) ControlSend("LinkCrews.com - Surf - Mozilla Firefox","","","{ESC}") EndIf sleep(2000) if $pixel2=$dec2 Then ControlSend("LinkCrews.com - Surf - Mozilla Firefox","","","{f5}") EndIf Until $Paused EndFunc while 1 sleep(100) WEnd Link to comment Share on other sites More sharing options...
JRowe Posted August 14, 2008 Share Posted August 14, 2008 (edited) You can't test for pixels on a non-visible window. If you use winActivate you can bring the test window into focus, and then your script should work. Edited August 14, 2008 by Jrowe [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
cppman Posted August 14, 2008 Share Posted August 14, 2008 (edited) This is kind of theory here but... I think you can pull the device context from a hidden(being minimized or whatever) window, and then get a pixel color from it that way. I know this would work on Windows Vista because Vista doesn't needlessly repaint windows. Edited August 14, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
ghostofdeath Posted August 15, 2008 Author Share Posted August 15, 2008 so why exactly would have the handle feature on pixelgetcolor? if its shown in window, you dont need a winhandle proprerty Link to comment Share on other sites More sharing options...
cppman Posted August 15, 2008 Share Posted August 15, 2008 (edited) so why exactly would have the handle feature on pixelgetcolor? if its shown in window, you dont need a winhandle proprertyAh, right. I was using an older-version that didn't have that parameter. I'm not sure what Windows does internally with the device context of a window when it is minimized, so I'm not sure. As far as I know, it'd work on Vista because the information in the device context (or surface, rather), won't change if the window is dragged off the screen, or minimized.Otherwise, I'm not sure. Edited August 15, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
ghostofdeath Posted August 16, 2008 Author Share Posted August 16, 2008 So.. anyone has any idea? Link to comment Share on other sites More sharing options...
Makalele Posted August 19, 2008 Share Posted August 19, 2008 I have the same problem.. It's harder what you think. Now i can't find this topic but i know it's impossible to do in AutoIt but possible for C++.I don't know C++, but read this: http://www.fengyuan.com/article/wmprint.html If you are good in c++ you can write small code, create dll library and then use this in autoit (by DllCall function). If you will do it conctact with me. I also need this. 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