AutoHotkey Community

It is currently May 25th, 2012, 3:01 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: August 16th, 2007, 9:09 pm 
Offline

Joined: September 30th, 2005, 5:15 pm
Posts: 58
Location: Fort Wayne, IN
Is there a simple way to center the text of a tooltip within a window?

I have code to calculate the center of the window. However, if the tooltip is, "This is my tooltip to display.", then "This" is put in the center, and the remaining text is right of center. I want the center of the text string put in the center of the window.

My only thought is to somehow calculate the pixel length of the tooltip, but I'm not sure how to do that. I'm not sure how Windows determines what font and font size to use for a tooltip either.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 16th, 2007, 9:18 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Tooltip is a Window :

Code:
Tooltip, The Quick Brown Fox Jumps Over The Lazy Dog!, 10,10
WinGetPos, X,Y,W,H, ahk_class tooltips_class32
MsgBox, 64, Size of the Tooltip Window, % X "-" Y "-" W "-" H


:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 16th, 2007, 9:46 pm 
Offline

Joined: September 30th, 2005, 5:15 pm
Posts: 58
Location: Fort Wayne, IN
Sweet. That works.

Thanks Skan.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: azure, BrandonHotkey and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group