Sign in to follow this  
Followers 0
cm00

How to get imagesearch to check only the active window

6 posts in this topic

    $x1=0
    $y1=0
    
    $result = _ImageSearch("xxx.bmp",1,$x1,$y1,100)
    if $result=1 Then
       
    ToolTip(" found! ", 400, 3)   
    MouseMove($x1,$y1,20)
    MouseClick("right",$x1,$y1)
    Sleep(1000)
    MouseMove($x1 +65, $y1 +7 ,20)
    Sleep(2000)
    
    
    
      Else
      ToolTip(" not! ", 400, 3)
      Sleep(500)
      
 EndIf

The problem i am having is it searches the whole computer screen, i want it to search only the active window. I'm not very experienced with autoit, can anyone tell me a simple way to change this to search only the active window?

Share this post


Link to post
Share on other sites



Hi,

Welcome to the autoit forum :)

Please use autoit code tags to post your code.

What is the FINAL purpose of this script?

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Hi,

Welcome to the autoit forum :)

Please use autoit code tags to post your code.

What is the FINAL purpose of this script?

Br, FireFox.

How do i use auto it code tags?

For web browsing searches.

Share this post


Link to post
Share on other sites

How do i use auto it code tags?

'?do=embed' frameborder='0' data-embedContent>>

For web browsing searches.

Can you elaborate please?

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

How do i use auto it code tags?

For web browsing searches.

You can use the IE.au3 commands to do much of what you need. Whats the name of the site? Odds are someone has already done what you are trying to do and we can point you to their code. That would save you time.

Share this post


Link to post
Share on other sites

Perhaps looking at WinGetPos() in the help file will also give you some clues, but this does seem a long way to search for something on the internet. Are you sure that your automation will be legitimate?

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