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 

Using WM_SETFONT - 0x30 on CHM help files in XP

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Visioneer



Joined: 19 Nov 2007
Posts: 144

PostPosted: Sun Apr 19, 2009 8:14 pm    Post subject: Using WM_SETFONT - 0x30 on CHM help files in XP Reply with quote

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 Sun Apr 26, 2009 3:45 am; edited 3 times in total
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Apr 19, 2009 11:52 pm    Post subject: Reply with quote

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
Back to top
Guest






PostPosted: Sun Apr 19, 2009 11:57 pm    Post subject: Reply with quote

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
Back to top
Visioneer



Joined: 19 Nov 2007
Posts: 144

PostPosted: Mon Apr 20, 2009 12:21 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Visioneer



Joined: 19 Nov 2007
Posts: 144

PostPosted: Mon Apr 20, 2009 12:29 am    Post subject: Reply with quote

By the way, I tried both versions you posted and they both worked
in W98, but neither in XP.
Back to top
View user's profile Send private message
Visioneer



Joined: 19 Nov 2007
Posts: 144

PostPosted: Wed Apr 22, 2009 1:09 am    Post subject: Reply with quote

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 Sun Apr 26, 2009 3:46 am; edited 1 time in total
Back to top
View user's profile Send private message
svi



Joined: 09 Oct 2006
Posts: 236
Location: Finland

PostPosted: Sat Apr 25, 2009 5:53 pm    Post subject: Reply with quote

In XP "only" tooltip seems to accept font change via a message.
EDIT: Scripts own tooltip Exclamation

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 Rolling Eyes

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 Wed Apr 29, 2009 9:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
Visioneer



Joined: 19 Nov 2007
Posts: 144

PostPosted: Mon Apr 27, 2009 11:15 pm    Post subject: Reply with quote

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/viewtopic.php?p=265538#265538
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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