Touch Posted June 3, 2009 Posted June 3, 2009 Hi, I'm currently running a function every 250 milliseconds using AdlibEnable. If something happens then a tooltip is shown. However, the problem may not always be fixed instantly, and so the tooltip will be shown again. Is there anyway to only show it IF it's not already showing? Thanks, Touch! [center][font="Arial"]If practise makes perfect and no-ones perfect whats the point of practise?[/font]Sorry for my rude attitude when I started here.[/center]
James Posted June 3, 2009 Posted June 3, 2009 I think you're looking for this function, TrayTipWait() I can't remember who wrote it. Func _TrayTipWait($s_TrayTitle, $s_TrayText, $i_TimeOut, $i_Option = 0) Local $i_PrevMatchMode = Opt("WinTitleMatchMode", 4) Local $i_StartTimer, $aWindows, $h_TrayTip, $b_Clicked = 0 If $s_TrayText = "" Then TrayTip("", "", 30) Else $i_StartTimer = TimerInit() TrayTip($s_TrayTitle, $s_TrayText, 30, $i_Option) $aWindows = WinList("[CLASS:tooltips_class32]") For $iX = 1 To $aWindows[0][0] If BitAND(WinGetState($aWindows[$iX][1]), 2) Then $h_TrayTip = $aWindows[$iX][1] ExitLoop EndIf Next While BitAND(WinGetState($h_TrayTip), 2) And (TimerDiff($i_StartTimer) < (1000 * $i_TimeOut)) Sleep(100) WEnd If TimerDiff($i_StartTimer) < (1000 * $i_TimeOut) Then $b_Clicked = 1 Else TrayTip("", "", 10) $b_Clicked = 0 EndIf EndIf Opt("WinTitleMatchMode", $i_PrevMatchMode) Return $b_Clicked EndFunc ;==>_TrayTipWait Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Moderators SmOke_N Posted June 3, 2009 Moderators Posted June 3, 2009 I think you're looking for this function, TrayTipWait() I can't remember who wrote it. Func _TrayTipWait($s_TrayTitle, $s_TrayText, $i_TimeOut, $i_Option = 0) Local $i_PrevMatchMode = Opt("WinTitleMatchMode", 4) Local $i_StartTimer, $aWindows, $h_TrayTip, $b_Clicked = 0 If $s_TrayText = "" Then TrayTip("", "", 30) Else $i_StartTimer = TimerInit() TrayTip($s_TrayTitle, $s_TrayText, 30, $i_Option) $aWindows = WinList("[CLASS:tooltips_class32]") For $iX = 1 To $aWindows[0][0] If BitAND(WinGetState($aWindows[$iX][1]), 2) Then $h_TrayTip = $aWindows[$iX][1] ExitLoop EndIf Next While BitAND(WinGetState($h_TrayTip), 2) And (TimerDiff($i_StartTimer) < (1000 * $i_TimeOut)) Sleep(100) WEnd If TimerDiff($i_StartTimer) < (1000 * $i_TimeOut) Then $b_Clicked = 1 Else TrayTip("", "", 10) $b_Clicked = 0 EndIf EndIf Opt("WinTitleMatchMode", $i_PrevMatchMode) Return $b_Clicked EndFunc ;==>_TrayTipWaithttp://www.autoitscript.com/forum/index.ph...hl=_TrayTipWait Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now