ToolTipFont / ToolTipColor - options for the ToolTip command

Post your working scripts, libraries and tools
lexikos
Posts: 6129
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: 525
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: 6434
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: 370
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: 116
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: 370
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 1496 times
Last edited by rommmcek on 04 Feb 2017, 08:05, edited 1 time in total.
rommmcek
Posts: 370
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 1397 times
rommmcek
Posts: 370
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: 1004
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..
https://github.com/flipeador/Library-AutoHotkey/blob/master/gui/ToolTip.ahk
Windws 1♂ Pro 64-Bits I make scripts for AHKv2 (my v2 compiler) & WIN_7+ Spanish Argentina SublimeText 3 & AHKv2 My GDI+ Library
Gris

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

27 Jul 2018, 21:14

Just starting to learn AHK. How do I use this script? Do I compile the code and then put ToolTipColor("Black", "White") in my script?
Tried that and it didn't work. Any suggestions?
User avatar
joedf
Posts: 6434
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

02 Aug 2018, 13:11

The example script provided here is a good place to start :+1:
https://autohotkey.com/boards/viewtopic ... 472#p27472
drozdman
Posts: 63
Joined: 05 Dec 2015, 01:07

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

15 Aug 2018, 18:23

This has been working well, but recently I tried to use it with this script Sets of hotkeys and I got SetClipboardData error.

Like in this test script. Try using Ctrl+G several times for copying text.


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

User avatar
joedf
Posts: 6434
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

17 Aug 2018, 07:50

How fast are you pressing Ctrl+G between each interval?
drozdman
Posts: 63
Joined: 05 Dec 2015, 01:07

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

17 Aug 2018, 09:59

@joedf
It doesn't have to be fast. I just select some text and press the hotkey, then another text and so on (a few seconds between).
Sometimes it happens with the first hotkey.

So other people don't experience this? I tried to run it without other scripts running, but it still happens.
ahk7
Posts: 107
Joined: 06 Nov 2013, 16:35

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

18 Aug 2018, 08:41

I get that error too - I tried to add this to my CL3 clipboard script for the "cycle through history" tooltips but when releasing the key that would assign the chosen text to the clipboard and paste it this error shows up.
burque505
Posts: 545
Joined: 22 Jan 2017, 19:37

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

18 Aug 2018, 11:26

@flipeador, thanks for that class! Here's a first shot at a translation into English. If you get a chance to make sure it's at least close to correct, I'd really appreciate it.
Spoiler

Regards,
burque505
User avatar
Flipeador
Posts: 1004
Joined: 15 Nov 2014, 21:31
GitHub: Flipeador
Location: Argentina
Contact:

Re: ToolTipFont / ToolTipColor - options for the ToolTip command

18 Aug 2018, 12:38

@burque505 Looks good. Anyway I'm not good at writing documentation, I'm always discontent and I rewrite everything (the same happens to me with the coding style). :lolno: :lol: :facepalm:
:wave:
Windws 1♂ Pro 64-Bits I make scripts for AHKv2 (my v2 compiler) & WIN_7+ Spanish Argentina SublimeText 3 & AHKv2 My GDI+ Library

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 26 guests