Queener Posted August 5, 2013 Share Posted August 5, 2013 (edited) I'm not able to get this to work: I'm getting error stating "ImageSearch() called with wrong number of args". On Line: $result = _Imagesearcharea("cpu.bmp",1,0,0,@DesktopWidth,@DesktopHeight,$x1,$y1,100) When I tried that code alone; it works fine. Just not with the combobox. expandcollapse popupHotKeySet("{ESC}", "Quit") #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Include <ImageSearch.au3> $Form1 = GUICreate("Example Program", 315, 149, 192, 114) $combo_Selection = GUICtrlCreateCombo("", 24, 24, 241, 25) GUICtrlSetOnEvent(-1, "Combo") $label_RelatedInfo = GUICtrlCreateLabel("label_RelatedInfo", 24, 64, 87, 17) GUISetState(@SW_SHOW) Opt("GUIOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate") GUICtrlSetData($combo_Selection, "CPUSlot|MemorySlot|CMOSBattery","") $x1 = 0 $y1 = 0 While 1 Sleep(1000) WEnd Func Combo() Call(GUICtrlRead($combo_Selection)) EndFunc Func CPUSlot() $result = _Imagesearcharea("cpu.bmp",1,0,0,@DesktopWidth,@DesktopHeight,$x1,$y1,100) if $result=1 Then Mousemove($x1,$y1,1) sleep(1000) EndIf EndFunc Edited August 5, 2013 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Gianni Posted August 5, 2013 Share Posted August 5, 2013 hi asianqueen tryed to declare $x1 and $y1 as Global? bye Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Queener Posted August 5, 2013 Author Share Posted August 5, 2013 nope... tried. Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Solution Gianni Posted August 5, 2013 Solution Share Posted August 5, 2013 could you try $result = _ImageSearch("cpu.bmp",1,$x1,$y1,100) instead of $result = _Imagesearcharea("cpu.bmp",1,0,0,@DesktopWidth,@DesktopHeight,$x1,$y1,100) Queener 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Queener Posted August 6, 2013 Author Share Posted August 6, 2013 thanks... work!!! Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") 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