Jump to content

Recommended Posts

Posted

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?

Regards,

Cueball.

; 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>

#NoTrayIcon

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)

DirCreate($UserPath)

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)

Exit

EndIf

;_ArrayDisplay($InpStr, "Array Contents")

$IniTitle = $InpStr[1]

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

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

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

Next

$IniTitle = StringLeft($IniTitle, 63)

$IniMsg = StringLeft($IniMsg, 255)

TraySetState()

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

_GoIntra()

ExitLoop

EndIf

EndIf

; Select

; Case $msg = 0

; ContinueLoop

; Case $msg = -11

; _GoIntra()

;Msgbox(64,"about:","AutoIt3-Tray-sample")

; ExitLoop

; EndSelect

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

WEnd

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

Exit

;Functions

Func _GoIntra()

Run("C:\Program Files\Internet Explorer\IExplore.exe http://intranet.website.uk")

EndFunc

Posted

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

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
  • Recently Browsing   0 members

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