AutoHotkey Community

It is currently May 26th, 2012, 5:51 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: April 19th, 2009, 9:14 pm 
Offline

Joined: November 19th, 2007, 4:59 pm
Posts: 144
Hi,

It seems that XP won't properly update fonts in
EXTERNAL WINDOWS controls using ahk.

I have used all sorts of ways to get a font handle
or create a font, [myhfont], and they all work on W98,
and maybe Vista, but I would like someone to verify this.
But never in XP. I have tried on 2 XP machines,

I use WM_SETFONT - 0x30 to try to set the font
in the EXTERNAL WINDOWS controls.

SendMessage, 0x30, myhFont, 1, Control, Wintitle

In XP, it just makes the font bold, but never increases
the font size.

Maybe there is a different way to do the WM_SETFONT part,
like a dllcall, a COM call ?

Maybe a separate exe in C or something could be made?

Is this an ahk bug, or an insurmountable limitation of XP?
Vista?

Any ideas how get around this would be very appreciated.

Thanks


Last edited by Visioneer on April 26th, 2009, 4:45 am, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2009, 12:52 am 
This works for me in Vista:

Code:
hFont := DllCall("CreateFont",uint,20
                              , int,0
                              , int,0
                              , int,0
                              , int,646
                              , int,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , str, "Arial")
                              
z::SendMessage, 0x30, hFont, 1, SysTabControl321, ahk_class HH Parent


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2009, 12:57 am 
Pasted the wrong test. Here is the corrected one:

Code:
hFont := DllCall("CreateFont",int,20
                              , int,0
                              , int,0
                              , int,0
                              , int,646
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , uint,0
                              , str, "Arial")
                              
z::SendMessage, 0x30, hFont, 1, SysTabControl321, ahk_class HH Parent


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2009, 1:21 am 
Offline

Joined: November 19th, 2007, 4:59 pm
Posts: 144
Thanks for responding!

I tried that in W98, and it works, but not in XP.
Could you try a larger height:
DllCall("CreateFont",uint,50
to be sure it is really making it bigger.

If this works in Vista, that is good news. Maybe there is
something only in XP that stops it from working.
I have tried this with 2 XP machines. I don't have Vista
yet.

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2009, 1:29 am 
Offline

Joined: November 19th, 2007, 4:59 pm
Posts: 144
By the way, I tried both versions you posted and they both worked
in W98, but neither in XP.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 22nd, 2009, 2:09 am 
Offline

Joined: November 19th, 2007, 4:59 pm
Posts: 144
Still waiting for any XP help.

These all work in W98 and maybe Vista but not XP!

Why does it work in W98 and maybe Vista, but not XP ?

Thanks


Last edited by Visioneer on April 26th, 2009, 4:46 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2009, 6:53 pm 
Offline

Joined: October 9th, 2006, 8:19 pm
Posts: 236
Location: Finland
In XP "only" tooltip seems to accept font change via a message.
EDIT: Scripts own tooltip :!:

In Notepad the font changes to Bold System 10 (available System fonts are Bold and Bold Italic, only in size 10), and the change is temporal: if you change Word Wrap property, the former font is restored...

So I'm also an asker, not an answerer :roll:

EDIT:
Using the following script you can test which windows accept font change using WM_SETFONT (control under mouse cursor): If the font changes to strikeout style, it works.
Eg. script's own messagebox, script's main window (normally hidden) and surprisingly WordPad are those which do.

Code:
F9::

MouseGetPos, , , win, control
hFont := DllCall("CreateFont",uint,20 ; int nHeight
                              , int,0 ; int nWidth
                              , int,0 ; int nEscapement
                              , int,0 ; int nOrientation
                              , int,646 ; int fnWeight
                              , int,0 ; DWORD fdwItalic
                              , uint,0 ; DWORD fdwUnderline
                              , uint,True ; DWORD fdwStrikeOut
                              , uint,0 ; DWORD fdwCharSet
                              , uint,0 ; DWORD fdwOutPutPrecision
                              , uint,0 ; DWORD fdwClipPrecision
                              , uint,0 ; DWORD fdwQuality
                              , uint,0 ; DWORD fdwPitchAndFamily
                              , str, "Arial") ; LPCTSTR lpszFace
                             
SendMessage 0x30, hfont, True, %control%, ahk_id %win%
Return

_________________
Pekka Vartto


Last edited by svi on April 29th, 2009, 10:57 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2009, 12:15 am 
Offline

Joined: November 19th, 2007, 4:59 pm
Posts: 144
Thanks svi,

Neat method to quickly test external windows that have
this problem. Could you or someone please try it on
a Vista with a larger font size, say 37, on a chm help file
(ahk_class HH Parent). Try it on the Tabs, TOC, Index,
Search, Favorites listings, and the Edits.

Also there some further insight to this problem on this post I
made in General Discussion to point out that the problem exists
in XP for many windows apps.

http://www.autohotkey.com/forum/viewtop ... 538#265538


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: batto, BrandonHotkey, G. Sperotto, Google [Bot], Miguel, Mtes, rafaelloureiro, Yahoo [Bot] and 71 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