Realm Posted September 22, 2010 Share Posted September 22, 2010 I was setting some rather long tooltips with GUICtrlSetTip(), and it tends to timeout before I can finish reading the tip. Is there a way to increase the delay in the timeout? My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
KaFu Posted September 22, 2010 Share Posted September 22, 2010 Here's my custom tooltip function, should do the trick ... expandcollapse popup#include<Timers.au3> HotKeySet("{ESC}", "_Exit") Global $__timer_ToolTipEx, $__timer_ToolTipEx_Timeout, $__timer_ToolTipEx_Idle, $__timer_ToolTipEx_Idle_Save _ToolTipEx("Text....suicidal tooltip example #1...", @DesktopWidth / 2, @DesktopHeight / 2, "_ToolTipEx Title", Default, Default, 2000, 2000) While 1 Sleep(1000) ConsoleWrite(TimerInit() & @TAB & "Main" & @CRLF) WEnd Func _ToolTipEx($sText, $iX = Default, $iY = Default, $sTitle = "", $iIcon = 0, $iOptions = 0, $iTimoutMS = 0, $iTimout_IldeFaderMS = 0, $hWnd = 0) ; #FUNCTION# ==================================================================================================================== ; Name...........: _ToolTipEx ; Description....: Custom ToolTip function ; Syntax.........: _ToolTipEx($sText, $iX = Default, $iY = Default, $sTitle = "", $iIcon = 0, $iOptions = 0, $iTimoutMS = 0, $iTimout_IldeFaderMS = 0, $hWnd = 0) ; Parameters.....: $sText - ToolTip Text ; $iX - x position of ToolTip ; $iY - y position of ToolTip ; $sTitle - Title ; $iIcon - (see ToolTip syntax) ; $iOptions - (see ToolTip syntax) ; $iTimoutMS - Timeout ToolTip after x ms ; $iTimout_IldeFaderMS - Delay ToolTip timeout while computer idle (timeout starts when mouse is moved or key is pressed) ; $hWnd - Control handle to attach ToolTip to, overrides x and y ; Return values..: - ; Author.........: KaFu ; =============================================================================================================================== If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) If Not IsHWnd($hWnd) Then If IsKeyword($iX) Or IsKeyword($iY) Then $aMousePos = MouseGetPos() If IsKeyword($iX) Then $iX = $aMousePos[0] If IsKeyword($iY) Then $iY = $aMousePos[1] EndIf Else $aWinPos = WinGetPos($hWnd) $iX = $aWinPos[0] + $aWinPos[2] $iY = $aWinPos[1] + $aWinPos[3] EndIf ToolTip($sText, $iX, $iY, $sTitle, $iIcon, $iOptions) $__timer_ToolTipEx_Timeout = $iTimoutMS Switch $iTimout_IldeFaderMS Case 0 $__timer_ToolTipEx_Idle = 0 AdlibRegister("__ToolTipEx_KillSelf", $__timer_ToolTipEx_Timeout) Case Else $__timer_ToolTipEx_Idle = $iTimout_IldeFaderMS $__timer_ToolTipEx_Idle_Save = _Timer_GetIdleTime() AdlibRegister("__ToolTipEx_KillSelf", 100) EndSwitch EndFunc ;==>_ToolTipEx Func __ToolTipEx_KillSelf() Switch $__timer_ToolTipEx_Idle Case 0 ToolTip("") AdlibUnRegister("__ToolTipEx_KillSelf") Case Else $i_Timer_GetIdleTime = _Timer_GetIdleTime() If $i_Timer_GetIdleTime < $__timer_ToolTipEx_Idle_Save Then $__timer_ToolTipEx_Idle = 0 AdlibRegister("__ToolTipEx_KillSelf", $__timer_ToolTipEx_Timeout) ;ConsoleWrite(TimerInit() & @TAB & "Timer #2" & @TAB & $__timer_ToolTipEx_Timeout & @TAB & $__timer_ToolTipEx_Idle & @TAB & $__timer_ToolTipEx & @CRLF) Else $__timer_ToolTipEx_Idle_Save = $i_Timer_GetIdleTime AdlibRegister("__ToolTipEx_KillSelf", 100) ;ConsoleWrite(TimerInit() & @TAB & "Timer #1" & @TAB & $__timer_ToolTipEx_Timeout & @TAB & $__timer_ToolTipEx_Idle & @TAB & $__timer_ToolTipEx & @CRLF) EndIf EndSwitch Return True EndFunc ;==>__ToolTipEx_KillSelf Func _Exit() Exit EndFunc ;==>_Exit OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Realm Posted September 22, 2010 Author Share Posted September 22, 2010 Very Nice function KaFu, I really appreciate that you have shared this with me. Not only does it appear to be exactly what I need, but it opens many opportunities for me as well. This particular script, had me look more in depth at AdlibRegister() for the first time, which may be the answer to another dilemma I have been facing with a different project as well. Thanks for taking the time to share this with me Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
KaFu Posted September 22, 2010 Share Posted September 22, 2010 You're welcome . Especially the fact that functions registered via AdlibRegister() can unregister / kill themselves makes this combo a perfect fit for e.g. observing onetime events. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
wakillon Posted September 22, 2010 Share Posted September 22, 2010 rasim have made a Tooltip Udf some years ago ... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
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