Jump to content

Action when clicking balloon


GooG
 Share

Recommended Posts

Is it possible to show a message when clicking a balloon?

Something like this, but working:

$Balloon = TrayTip("Title", "Random Text", "", 1)

While 1
  $msg = TrayGetMsg()
  If $msg = $Balloon Then MsgBox(0,"Show this","")
WEnd
Link to comment
Share on other sites

This is a trick:

#include <WinAPI.au3>
#include <Misc.au3>

$DllHandle = DllOpen("user32.dll")

TrayTip("Tip Title", "TipText", 30)

$hWnd = _WinAPI_FindWindow("tooltips_class32", "")

$aWinPos = WinGetPos($hWnd)

While 1
    If _IsPressed("01", $DllHandle) Then
        $aMousePos = MouseGetPos()
        If ($aMousePos[0] >= $aWinPos[0]) And ($aMousePos[0] <= $aWinPos[0] + $aWinPos[2]) And _
            ($aMousePos[1] >= $aWinPos[1]) And ($aMousePos[1] <= $aWinPos[1] + $aWinPos[3]) Then
            ConsoleWrite("Clicked on baloon" & @LF)
            TrayTip("Tip Title", "TipText", 30)
        EndIf
    EndIf
    Sleep(100)
WEnd

DllClose($DllHandle)
:D
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...