Jump to content

If text exist, close it.


Recommended Posts

Hey, there is simple problem, i dont know how to make to close this window, when vpn connect's, script are waiting for text that is connected, but once i get this text (that there is windows dublicate already exist) it wont show up.. So.. i tried if winexist, but nothing.. it does not worked for me.

 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <FF.au3>
Global $a;
Global $text;
Global $text2
Global $t
Opt("WinTitleMatchMode", 2)


sleep(25000)
Do
      WinActivate("Connect strongVPN")
Send("{ENTER}")
    $text = 0
    $text2 = 0
    Do
  if WinExists("Error Connecting to strongVPN") then
WinActivate("Error Connecting to strongVPN")
Send("{ENTER}")
endif
   
        $text = ControlGetText("[CLASS:tooltips_class32]", "", "")
        $text2 = StringTrimRight($text, 28)
        ConsoleWrite(">" & $text2 & "<" & @CRLF)
        Sleep(100)
   Until $text2 = "Click " 
Until $text2 = "Click " 
Run("C:\Documents and Settings\Administrator\Desktop\bam.exe")

How could i do it?

 

post-59586-0-29471600-1381225095_thumb.j

Link to comment
Share on other sites

See if there's any help in >this post for getting tooltips from another application. I know it works for applications, just not sure how it would do it for a system icon.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

i had made a script near to what you are making 

i used it when a specified tray tip is view Autoit will make a beep sound and will give me a msgbox

While 1
$text = WinGetTitle("[CLASS:tooltips_class32]", "")
If StringInStr($text, "VIP") Then VIP()
If StringInStr($text, "System Update") Then closetip()
Sleep(1)
WEnd

Func closetip()
$pos = MouseGetPos()
MouseClick("left", 638, 665, 1, 0)
MouseMove($pos[0] , $pos[1], 0)
EndFunc

Func VIP()
    Beep(1000, 1000)
    Sleep(1000)
    Beep(1000, 1000)
    Sleep(1000)
    Beep(1000, 1000)
    MsgBox(0,"", "VIP !")
EndFunc

i hope that was helpfull

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...