greensky Posted December 2, 2005 Posted December 2, 2005 How can I know how much screen space a ToolTip with some text is going to take? I'd like to be able to position a ToolTip in the upper-right corner of the screen... without the ToolTip going off the screen, of course. Is there any Windows API function for calculating this (given the text and font name, size, etc.)? I'd really appreciate any help with this... Thanks!
Valuater Posted December 2, 2005 Posted December 2, 2005 maybe this #include <GUIConstants.au3> $tip_info = "tip information now displaying" $pos = StringLen($tip_info) ToolTip($tip_info,@DesktopWidth - ($pos * 5), 0) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop ;Case $msg = $GUI_Button EndSelect Wend 8)
GaryFrost Posted December 2, 2005 Posted December 2, 2005 $ToolTipText = "This is a Tooltip in the upper" & @LF & "right corner" ToolTip($ToolTipText, @DesktopWidth, 0) $pos = WinGetPos($ToolTipText) WinMove($ToolTipText, "", @DesktopWidth - $pos[2], 0) Sleep(2000); Sleep to give tooltip time to display SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
greensky Posted December 2, 2005 Author Posted December 2, 2005 Humm... Those will work! That one using WinGetPos... very ingenious! Thank you!
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