AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WM_GETFONT/WM_SETFONT fun (changing font for tooltips)

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Roland



Joined: 08 Jun 2006
Posts: 307

PostPosted: Thu Aug 24, 2006 2:03 pm    Post subject: WM_GETFONT/WM_SETFONT fun (changing font for tooltips) Reply with quote

Just playing around with WM_GETFONT and WM_SETFONT a little...
I have no clue how to create a font, so I let AHK do that part Smile

Code:
 f9::
font := CreateFont("bold s50", "Matisse ITC")
Tooltip, Wow! A monster tooltip!
WinWait ahk_class tooltips_class32
SetFont("", WinExist(), font)
return

CreateFont(options="", font="") {
Loop 99 {
    g = %a_index%
    Gui %g%: +LastfoundExist
    If ! WinExist()
      break
  }
Gui, %g%: +Lastfound
Gui, %g%: Font, %options%, %font%
Gui, Add, Button
SendMessage, 0x31, 0, 0, Button1  ;WM_GETFONT
Gui, %g%: Destroy
return errorLevel
}

SetFont(ctrl, win, font=0) {
SendMessage, 0x30, %font%, 1, %ctrl%, ahk_id%win%
return errorLevel
}
Back to top
View user's profile Send private message
robiandi



Joined: 08 Aug 2006
Posts: 49

PostPosted: Thu Aug 24, 2006 2:34 pm    Post subject: Reply with quote

@Roland: If your playing gives such results Surprised , please for the sake of the AutoHotkey community play very frequently
Back to top
View user's profile Send private message
ewerybody



Joined: 18 Sep 2006
Posts: 61

PostPosted: Wed Jan 19, 2011 11:44 am    Post subject: Reply with quote

*BUMP*!! This is great! I was just struggling with finding the solution for this! Very Happy

I found Raphaels Example: and just added
SendMessage, 0x30, %aSimpleNumber%,0,, ahk_id %tThWnd1%

which already yielded "some" results ^^ but not quite with any control!

So THanks So much!!
Incredible this wasn't found by so many peeps.
Back to top
View user's profile Send private message
ewerybody



Joined: 18 Sep 2006
Posts: 61

PostPosted: Wed Jan 19, 2011 11:58 am    Post subject: Reply with quote

ooops! I just read the code ^^ Very Happy
you create a control apply the font via Gui commands and get it back with the getfont sendmessage!

however.. is there a direct way through Autohotkey? via DllCall probably?
Back to top
View user's profile Send private message
ewerybody



Joined: 18 Sep 2006
Posts: 61

PostPosted: Wed Jan 19, 2011 12:08 pm    Post subject: Reply with quote

Ahhh okok. R&D done^^

majkinetor: made a handy function to create hfonts via DllCall: http://www.autohotkey.com/forum/viewtopic.php?p=124450#124450
Back to top
View user's profile Send private message
poserpro



Joined: 21 Oct 2010
Posts: 438

PostPosted: Sun Jul 17, 2011 8:48 am    Post subject: Re: WM_GETFONT/WM_SETFONT fun (changing font for tooltips) Reply with quote

Roland wrote:
Just playing around with WM_GETFONT and WM_SETFONT a little...
I have no clue how to create a font, so I let AHK do that part Smile

Code:
 f9::
font := CreateFont("bold s50", "Matisse ITC")
Tooltip, Wow! A monster tooltip!
WinWait ahk_class tooltips_class32
SetFont("", WinExist(), font)
return

CreateFont(options="", font="") {
Loop 99 {
    g = %a_index%
    Gui %g%: +LastfoundExist
    If ! WinExist()
      break
  }
Gui, %g%: +Lastfound
Gui, %g%: Font, %options%, %font%
Gui, Add, Button
SendMessage, 0x31, 0, 0, Button1  ;WM_GETFONT
Gui, %g%: Destroy
return errorLevel
}

SetFont(ctrl, win, font=0) {
SendMessage, 0x30, %font%, 1, %ctrl%, ahk_id%win%
return errorLevel
}


This is a great function to my purpose. I was trying to blowup the font size of tooltip, and its colour. I searched and found this great tool. Curtesy to you Wink

Just wonder how to custom the font [color=red]colour too ?[/color]
The weekend is a happy day to play with AHK Wink
-poserpro
_________________

~C'est La Vie~
I like AHK_L and Unicode Wink
Joined : Oct 11, 2010
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group