Jump to content

Recommended Posts

Posted

I don't think it's possible. You can have some color background using GUIToolTip UDF but for what you want I think the best way it's to make a custom window.

Posted (edited)

Okay! I got it working with an extra window.

 

Now I have one other questions: Although the window is on top, you should click below it. Is this possible?

The reason is that my tooltip is on top of my browser and I want to see the tooltip, but at the same time I want to operate the broswer. 

 

Thats my funtion:

Spoiler
Func _ToolTip($sText, $iX, $iY)

    Local $RetAr[2]
    ;Mainfenster erstellen
    $tooltipmain = GUICreate("", 123, 123, $iX, $iY, -2147483648, 128) ;$WS_POPUP = -2147483648, $WS_EX_TOOLWINDOW = 128
    GUISetBkColor(0XFFFFFF)

    ;Label mit Text erstellen
    Global $lab = GUICtrlCreateLabel($sText, 3, 3)
    $cgp = ControlGetPos($tooltipmain, "", $lab) ;Labelgröße rausfinden
    WinMove($tooltipmain, "", $iX, $iY, $cgp[2], $cgp[3]) ;Gui perfekt formen

    WinSetTrans($tooltipmain, "", 90)

    ;OnTop
    WinSetOnTop($tooltipmain, "", 1)

    ;Zeige Tooltip
    GUISetState(@SW_SHOW, $tooltipmain)

    ;Bereite das Return array vor, falls man das Tooltip wieder entfernen will
    $RetAr[0] = $tooltipmain
    Return $RetAr
EndFunc

 

 

Edited by Jotos
Posted (edited)

Here one way to make it more friendly.  As you can see the current window does not loose focus on the tooltip display.  But if the tooltip gets in the way, you can drag it elsewhere.

#include <GUIConstants.au3>

_ToolTip("Very Long Test" & @CRLF & "Very Very Long Test" & @CRLF & "Very Very Very Long Test", 200, 200)

Sleep(10000)

Func _ToolTip($sText, $iX, $iY)
  Local $tooltipmain = GUICreate("", 123, 123, $iX, $iY, BitOR($WS_POPUP, $WS_BORDER), _
    BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST , $WS_EX_CONTROLPARENT, $WS_EX_NOACTIVATE))
  GUISetBkColor(0XFFFFFF)
  Local $lab = GUICtrlCreateLabel($sText, 3, 3, -1, -1, -1, $GUI_WS_EX_PARENTDRAG)
  Local $cgp = ControlGetPos($tooltipmain, "", $lab)
  WinMove($tooltipmain, "", $iX, $iY, $cgp[2], $cgp[3])
  WinSetTrans($tooltipmain, "", 90)
  GUISetState(@SW_SHOWNOACTIVATE)
EndFunc

 

Edited by Nine

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
×
×
  • Create New...