Sign in to follow this  
Followers 0

Emulate XP ballon click operation

4 posts in this topic

Hi all,

I hoping someone can assist me in what seems quite simple. I have a tasktray icon that pops up a balloon.

What I'd like, is if the balloon is clicked, I could launch a IE window.

No matter how I try, I can't seem to accurately trap a click in the balloon.

Can anyone assist me please?



; AutoIT Script to display environment details in the Taskbar as a ToolTip.


#include <Constants.au3>

#include <File.au3>

#include <Array.au3>

#include <String.au3>

#include <Misc.au3>


AutoItSetOption("WinTitleMatchMode", 4)

Dim $TrayMsg, $Title, $Delay ,$ClientDets, $IniMsg, $InpStr[10], $IniTitle, $loop, $msg

Const $UserPath = (ENVGET("USERPROFILE")) & "\Application Data\AU3"

Const $Rdfile = "\\FileServer1\Software\PopUp\LogonMessage.txt"

$ClientDets = "Tag Number: " & @ComputerName & @CRLF & "Username : " & @UserName & @CRLF & "IP Address: " & @IPAddress1

$Title = "Your Logon Details"

$Delay = 1

$CTime = 0

Opt("GUIOnEventMode", 1)


FileInstall("E:\AutoIt Scripts\Icons\LEDOff.ico" , $UserPath & "\LEDOff.ico", 1)

FileInstall("E:\AutoIt Scripts\Icons\LEDOn.ico" , $UserPath & "\LEDOn.ico", 1)

FileCopy($Rdfile, $UserPath & "\LogonMessage.txt", 1)

If Not _FileReadToArray($UserPath & "\LogonMessage.txt", $InpStr) Then

MsgBox(4096, "Error", " Error reading Balloon text to Array... error:" & @error)



;_ArrayDisplay($InpStr, "Array Contents")

$IniTitle = $InpStr[1]

For $loop = 2 to (UBound($InpStr) - 1)

$IniMsg = $IniMsg & $InpStr[$loop] & @CRLF

; MsgBox(0,"",$InpStr[$loop])


$IniTitle = StringLeft($IniTitle, 63)

$IniMsg = StringLeft($IniMsg, 255)


TraySetIcon($UserPath & "\LEDOff.ico")

$TrayTip = TrayTip($IniTitle,$IniMsg, 0, 1)

$Ballon = WinGetHandle("classname=Shell_TrayWnd")

$TStart = TimerInit()

While $CTime <= 15000

$msg = TrayGetMsg()

$CTime = TimerDiff($TStart)

If _IsPressed(01) = 1 Then

If @GUI_WinHandle = "00030020" Then





; Select

; Case $msg = 0

; ContinueLoop

; Case $msg = -11

; _GoIntra()


; ExitLoop

; EndSelect

; MsgBox(0,"Done", $CTime & @CRLF & $msg)


;MsgBox(0,"Done", $CTime & @CRLF & $msg)



Func _GoIntra()

Run("C:\Program Files\Internet Explorer\IExplore.exe")


Share this post

Link to post
Share on other sites

I think you should check if the mouse is within the ballon ( using mousegetpos ) then using the _IsPressed udf to check if the mouse1 button is pressed to check if he user clicked within your balloon region...

Share this post

Link to post
Share on other sites

Thanx FreeFry.

I'll have a go at implementing that.


Share this post

Link to post
Share on other sites

No Problem mate! Best of luck :D

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