AutoHotkey Community

It is currently May 27th, 2012, 9:28 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: August 24th, 2006, 3:03 pm 
Offline

Joined: June 8th, 2006, 9:38 pm
Posts: 307
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 :)

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
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2006, 3:34 pm 
Offline

Joined: August 8th, 2006, 3:55 pm
Posts: 49
@Roland: If your playing gives such results :o , please for the sake of the AutoHotkey community play very frequently


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 19th, 2011, 12:44 pm 
Offline

Joined: September 18th, 2006, 5:38 pm
Posts: 61
*BUMP*!! This is great! I was just struggling with finding the solution for this! :D

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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 19th, 2011, 12:58 pm 
Offline

Joined: September 18th, 2006, 5:38 pm
Posts: 61
ooops! I just read the code ^^ :D
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 19th, 2011, 1:08 pm 
Offline

Joined: September 18th, 2006, 5:38 pm
Posts: 61
Ahhh okok. R&D done^^

majkinetor: made a handy function to create hfonts via DllCall: http://www.autohotkey.com/forum/viewtop ... 450#124450


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 17th, 2011, 9:48 am 
Offline

Joined: October 21st, 2010, 12:52 pm
Posts: 490
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 :)

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 ;)

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

_________________

~C'est La Vie~
I like AHK_L and Unicode ;-)
Joined : Oct 11, 2010


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher, nomissenrojb, Stigg and 15 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