Sign in to follow this  
Followers 0
Queener

working with combobox

5 posts in this topic

#1 ·  Posted (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.

HotKeySet("{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 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.")

Share this post


Link to post
Share on other sites



hi asianqueen

tryed to declare $x1 and $y1 as Global?
bye


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

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.")

Share this post


Link to post
Share on other sites

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)
1 person likes this

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

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.")

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0