Sign in to follow this  
Followers 0
danusko

if click on tooltip = exit script

1 post in this topic

Hi all,

i want make, that my script stops (exit), when i click with left mouse key on my tooltip.

I have this, but, it make something diferent. It clicks on tooltip.

Pls. how can i make conditon - if it click, do exit? And is possible, that the message box will blinking (f.e. for a second is MB white and then red.

Thanke you for your advise.

my script:

$d = @MDAY 
$m = @MON 
$r = @YEAR 
$h = @HOUR 
$mi = @MIN 
$info = 0
#include "C:\My documents\docs\AutoIt\Include\GUIConstants.au3"
AutoItSetOption ( "SendKeyDelay", 30 )

$u = @DesktopWidth - 120
$v= @DesktopHeight - 105

$g_szVersion = "My Script 1.1"
If WinExists($g_szVersion) Then 
$v = $v - 20
endif

AutoItWinSetTitle($g_szVersion)

$WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_EX_TOPMOST)
   GuiCreate("Pripomienka", 274, 75,(@DesktopWidth-280), (@DesktopHeight-250), )

$text = GuiCtrlCreateInput("", 10, 10, 250, 20)
$Combo_4 = GuiCtrlCreateCombo("1", 10, 40, 80, 21)
$ok2 = GuiCtrlCreateButton("OK", 110, 40, 60, 20)
 GUICtrlSetState( -1, $GUI_DEFBUTTON)
$cancel3 = GuiCtrlCreateButton("Zruit", 200, 40, 60, 20)
GuiCtrlSetData($combo_4, "5|10|30|60|90|120|240|360", "1")

GuiSetState()
GUISetBkColor ( 0xFF3401)
while 1
   
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
        
    Case $msg = $ok2
      $data = GUICtrlRead($Combo_4)
      $info = GUICtrlRead($text)
        GUISetState(@SW_HIDE)
        $data = $data *60
        for $x = $data to 1 Step -1

 
 ToolTip($x & " " & $info, $u, $v)

;       $pos = MouseGetPos()
        $pos = MouseClick("left", $u, $v, 2)



        If $pos[0] > $u And $pos[1] > $v Then
 ToolTip("", $u, $v)
            ExitLoop
        EndIf
        sleep(1000)
 ToolTip("", $u, $v)
        Next
        GUISetState(@SW_SHOW)

    Case $msg = $cancel3
         ExitLoop
    EndSelect
 


; GUISetBkColor (0xFFFFAC) 
; GUISetBkColor ( 0xFF3401)
 wend 
;---------------
$file = FileOpen("pripomienky.txt", 1)

If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWrite($file, $info & " - " & $d & "/" & $m  & "/" & $r & " " & $h & "," & $mi & @CRLF)

FileClose($file)

;---------------
Exit

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