Jump to content

ToolTip Question


Sardith
 Share

Recommended Posts

Is it possible, to display two or more tooltips at the same time.. without cause some form of blinking of the tooltips. Or not displaying at all?

I've done a few searches and i've came up short. Any help would be great.

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

Is it possible, to display two or more tooltips at the same time.. without cause some form of blinking of the tooltips. Or not displaying at all?

I've done a few searches and i've came up short. Any help would be great.

I don't think a tool tip is actually built and displayed by AutoIT. It is just a call to a Windows API that automaticaly replaces any existing ToolTip with the next one called for - in other words Windows provides the ToolTip feature and only allows one at a time.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

You can try /AutoIt3ExecuteScript, but there's some coding that will need to be done to make it efficient and work how you want it to.

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.

Link to comment
Share on other sites

Thanks for your replies

Testing proved me WRONG. :">

First script, compiled as TestOne.exe:

; TestOne.au3
HotKeySet("1", "Quit")

While 1
    For $i = 100 To 199
        ToolTip("Tool Tip: " & $i, 100, 100, "Mult-ToolTip One")
        Sleep(1000)
    Next
WEnd

Func Quit()
    Exit
EndFunc   ;==>QuitoÝ÷ Ù'¢wlr¸©µÊ&¦)^u«zËS±y«­¢+ØìQÍÑQݼ¹ÔÌ)!½Ñ-åMÐ ÅÕ½ÐìÈÅÕ½Ðì°ÅÕ½ÐíEÕ¥ÐÅÕ½Ðì¤()]¡¥±Ä(%½ÈÀÌØí¤ôÈÀÀQ¼Èää($%Q½½±Q¥À ÅÕ½ÐíQ½½°Q¥ÀèÅÕ½ÐìµÀìÀÌØí¤°ÐÀÀ°ÐÀÀ°ÅÕ½Ðí5ձеQ½½±Q¥ÀQݼÅÕ½Ðì¤($%M±À ÈÀÀÀ¤(%9áÐ)]¹()Õ¹EեР¤(%á¥Ð)¹Õ¹ìôôÐíEÕ¥Ð

Compiled them both and ran them at the same time. Only one ToolTip per process, but multiple ToolTips can be up at the same time from different processes.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

Testing proved me WRONG. :">

First script, compiled as TestOne.exe:

; TestOne.au3
HotKeySet("1", "Quit")

While 1
    For $i = 100 To 199
        ToolTip("Tool Tip: " & $i, 100, 100, "Mult-ToolTip One")
        Sleep(1000)
    Next
WEnd

Func Quit()
    Exit
EndFunc   ;==>QuitoÝ÷ Ù'¢wlr¸©µÊ&¦)^u«zËS±y«­¢+ØìQÍÑQݼ¹ÔÌ)!½Ñ-åMÐ ÅÕ½ÐìÈÅÕ½Ðì°ÅÕ½ÐíEÕ¥ÐÅÕ½Ðì¤()]¡¥±Ä(%½ÈÀÌØí¤ôÈÀÀQ¼Èää($%Q½½±Q¥À ÅÕ½ÐíQ½½°Q¥ÀèÅÕ½ÐìµÀìÀÌØí¤°ÐÀÀ°ÐÀÀ°ÅÕ½Ðí5ձеQ½½±Q¥ÀQݼÅÕ½Ðì¤($%M±À ÈÀÀÀ¤(%9áÐ)]¹()Õ¹EեР¤(%á¥Ð)¹Õ¹ìôôÐíEÕ¥Ð

Compiled them both and ran them at the same time. Only one ToolTip per process, but multiple ToolTips can be up at the same time from different processes.

:)

/AutoIt3ExecuteScript :P

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.

Link to comment
Share on other sites

/AutoIt3ExecuteScript :D

Actually, I've been trying to make /AutoIt3ExecuteLine make three ToolTips come up, but I haven't figured out the delimiting single and double quotes right yet. :)

This still gives errors:

For $i = 1 To 3
    $Text = 'Tool Tip: ' & $i
    $Pos = $i * 150
    $ExtCmd = '"ToolTip("' & $Text & '", ' & $Pos & ', ' & $Pos & ')"'
    Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $ExtCmd)
    Sleep(500)
Next

Sleep(10000)

Any hints? :P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

This requires there to be a main ToolTip, and only stays open as long as that tooltip is active... But I just wanted to show a proof of concept:

ToolTip('ToolTip1', 0, 0, '', '', '')
_ToolTipAu3ExSc('ToolTip2', 0, 20)
Sleep(5000)
ToolTip('')
Sleep(5000)

Func _ToolTipAu3ExSc($sText, $xCoord = '', $yCoord = '', $sTitle = '', $hIcon = '', $iOpt = '')
    $OptWMM = Opt('WinTitleMatchMode', 4)
    Local $hToolTiphWnd = WinGetHandle(WinGetTitle('classname=tooltips_class32')), $sSend
    Opt('WinTitleMatchMode', $OptWMM)
    $sSend = '#NoTrayIcon' & @CRLF & "ToolTip('" & $sText & "'," & $xCoord & ',' & $yCoord & ',"' & _
        $sTitle & '","' & $hIcon & '","' & $iOpt & '")' & @CRLF & "While ControlCommand(Hwnd('" & _
        $hToolTiphWnd & "')," & "'','', " & "'IsVisible', '')" & @CRLF & "Sleep(10)" & @CRLF & "WEnd"
    FileClose(FileOpen(@TempDir & '\ToolTipAu3ExSc.txt', 2))
    FileWrite(@TempDir & '\ToolTipAu3ExSc.txt', $sSend)
    ProcessWait(Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @TempDir & '\ToolTipAu3ExSc.txt"', '', @SW_HIDE))
    FileDelete(@TempDir & '\ToolTipAu3ExSc.txt')
    Return 1
EndFunc

Edit:

Migrated a function.

Edited by SmOke_N

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.

Link to comment
Share on other sites

This requires there to be a main ToolTip, and only stays open as long as that tooltip is active... But I just wanted to show a proof of concept:

ToolTip('ToolTip1', 0, 0, '', '', '')
_ToolTipAu3ExSc('ToolTip2', 0, 20)
Sleep(5000)
ToolTip('')
Sleep(5000)

Func _ToolTipAu3ExSc($sText, $xCoord = '', $yCoord = '', $sTitle = '', $hIcon = '', $iOpt = '')
    Local $hToolTiphWnd = WinGetHandle(_GetToolTipData()), $sSend
    Local $aScript[5] = ['#NoTrayIcon', _
            "ToolTip('" & $sText & "'," & $xCoord & ',' & $yCoord & ',"' & $sTitle & '","' & $hIcon & '","' & $iOpt & '")', _
            "While ControlCommand(Hwnd('" & $hToolTiphWnd & "')," & "'','', " & "'IsVisible', '')", _
            "Sleep(10)", _
            "WEnd"]
    For $iCC = 0 To UBound($aScript) - 1
        $sSend &= $aScript[$iCC] & @CRLF
    Next
    FileClose(FileOpen(@TempDir & '\ToolTipAu3ExSc.txt', 2))
    FileWrite(@TempDir & '\ToolTipAu3ExSc.txt', $sSend)
    Local $iPid = Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @TempDir & '\ToolTipAu3ExSc.txt"', '', @SW_HIDE)
    ProcessWait($iPid)
    ;FileDelete(@TempDir & '\ToolTipAu3ExSc.txt')
    Return 1
EndFunc

Func _GetToolTipData($sClass = 'tooltips_class32')
    $OptWMM = Opt('WinTitleMatchMode', 4)
    Local $vTTData = WinGetTitle('classname=' & $sClass)
    Opt('WinTitleMatchMode', $OptWMM)
    Return $vTTData
EndFunc
Yep. That works (nice function), but it's still creating a script file and running it. I was hoping to just fire it off with the "/AutoIt3ExecuteLine" option. :)
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

Yep. That works (nice function), but it's still creating a script file and running it. I was hoping to just fire it off with the "/AutoIt3ExecuteLine" option. :)

You can't do Line because nothing is there to keep that line running.

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.

Link to comment
Share on other sites

You can't do Line because nothing is there to keep that line running.

Ahhhhhhh so! Totaly missed that! :">

A couple of my attempts seemed to do nothing... those versions probably created the ToolTip, which then closed in microseconds. Hence the use of MsgBox() for the help file example. It all makes sense now.

Thanks. :)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...