ToolTipFont / ToolTipColor - options for the ToolTip command

Post your working scripts, libraries and tools
lexikos
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

06 Jul 2016, 23:07

@arcticir: Probably with TTM_SETMAXTIPWIDTH.

@rommmcek: Thanks for reporting the bug; I've fixed it.

I suppose you can simply use WinGetPos to get the dimensions of the tooltip.
arcticir
Posts: 494
Joined: 17 Nov 2013, 11:32

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

11 Jul 2016, 11:25

About TTM_SETMAXTIPWIDTH, Can you provide an example? :)
User avatar
joedf
Posts: 6293
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

11 Jul 2016, 22:59

@arcticir Try this? untested. :)

Code: [Select all] [Download] GeSHi © Codebox Plus

TT_SetMaxWidth(MaxWidth := -1, hwnd := "") {
; see https://msdn.microsoft.com/library/bb760408
WM_USER := 1024
TTM_SETMAXTIPWIDTH := (WM_USER+24)
SendMessage, %TTM_SETMAXTIPWIDTH%, 0, %MaxWidth%, , ahk_id %hwnd%
return %ErrorLevel%
}
rommmcek
Posts: 349
Joined: 15 Aug 2014, 15:18

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

01 Nov 2016, 12:11

It seems that I solved occasional broken display reported 07/06/16.
I use sleep, 0 or sleep, -1 before return DllCall("CallNextHookEx", "ptr", 0, "int", nCode, "ptr", _wp, "ptr", _lp, "ptr")

P.s.: Obviously I missed your answer:
I suppose you can simply use WinGetPos to get the dimensions of the tooltip.
Yes, this is after displaying! What about beforehand?
User avatar
Relayer
Posts: 112
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

01 Nov 2016, 14:09

Yes, this is after displaying! What about beforehand?


I have been using the Fnt library for this. It has functions that return size given the text you want to display. https://autohotkey.com/boards/viewtopic.php?t=4379

Relayer
rommmcek
Posts: 349
Joined: 15 Aug 2014, 15:18

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

28 Jan 2017, 09:14

@Relayer: Thanks, after initial trouble I started to like it! I even made a small contribution: https://autohotkey.com/boards/viewtopic ... 31#p128531

@lexikos: As much as I like ToolTipFont for it's simplicity to update old scripts, it seems that it's suitable only for simple code.
I've isolated three issues I encountered, two of them easily to reproduce!

Code: [Select all] [Expand] [Download] (Limitations 4 TTF.ahk)GeSHi © Codebox Plus

1. SendMessage inhibited.
2. Assigning to Clipboard make the script crash.
---------------------------
Limitations 4 TTF.ahk
---------------------------
Error in #include file "TooltipFont 1.005.ahk":
SetClipboardData

059: } Sleep,- 1
---> 060: Return,DllCall("CallNextHookEx", "ptr", 0, "int", nCode, "ptr", _wp, "ptr", _lp, "ptr")
061: }

The current thread will exit.
---------------------------
OK
---------------------------
3. Dialogs display blank if mouse cursor is off field where they appear or off field of script's Gui if visible (not allways reproducible, see pic.)

P.s.: These issues don't appear if running ToolTipFont functions from another script, however simplicity is obviously lost.
Attachments
Limitations 4 TTF.png
Limitations 4 TTF.png (90.72 KiB) Viewed 1139 times
Last edited by rommmcek on 04 Feb 2017, 08:05, edited 1 time in total.
rommmcek
Posts: 349
Joined: 15 Aug 2014, 15:18

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

04 Feb 2017, 08:01

I just had a surreal idea, what about Third Part Application ToolTips?
Using Serenity's functions & this very handy ToolTipFont by lexikos I got some success, however ToolTips in Explorers Control DirectUIHWND3 are updated only if triggering of the next ToolTip (form the same Control) occurs in less then circa 300 ms after pervious one (being still displayed).

Code: [Select all] [Expand] [Download] (ToolTipAll.ahk)GeSHi © Codebox Plus

P.s.: Any improvements are appreciated!
Attachments
ToolTipAll.png
ToolTipAll.png (50.55 KiB) Viewed 1040 times
rommmcek
Posts: 349
Joined: 15 Aug 2014, 15:18

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

02 Dec 2017, 11:21

After almost one year using ToolTipFont for ToolTipAll now I switched to Fnt library! It shouldn't affect other processes and is more reliable.
chegr
Posts: 8
Joined: 04 Feb 2018, 09:36

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

04 Mar 2018, 13:52

I'd expected to see this natively in v2, but nope! I'll try to get it working...
User avatar
Flipeador
Posts: 782
Joined: 15 Nov 2014, 21:31
GitHub: Flipeador
Location: Argentina
Contact:

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

04 Mar 2018, 14:03

chegr wrote:I'd expected to see this natively in v2, but nope! I'll try to get it working...

I have a ToolTip class for AHK v2, maybe you're interested, it's in the forum in Spanish but it includes an example. Personally I think it should be implemented natively in the versión 2. I created this class based on GuiControlTips by just me, all credits for him..
Windws 1♂ Pro 64-Bits I make scripts for AHKv2 (my v2 compiler) & WIN_7+ Spanish Argentina SublimeText 3 & AHKv2

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Relayer and 13 guests