 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Visioneer
Joined: 19 Nov 2007 Posts: 144
|
Posted: Sun Apr 19, 2009 8:14 pm Post subject: Using WM_SETFONT - 0x30 on CHM help files in XP |
|
|
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 |
|
 |
Guest
|
Posted: Sun Apr 19, 2009 11:52 pm Post subject: |
|
|
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
|
Posted: Sun Apr 19, 2009 11:57 pm Post subject: |
|
|
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
|
Posted: Mon Apr 20, 2009 12:21 am Post subject: |
|
|
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 |
|
 |
Visioneer
Joined: 19 Nov 2007 Posts: 144
|
Posted: Mon Apr 20, 2009 12:29 am Post subject: |
|
|
By the way, I tried both versions you posted and they both worked
in W98, but neither in XP. |
|
| Back to top |
|
 |
Visioneer
Joined: 19 Nov 2007 Posts: 144
|
Posted: Wed Apr 22, 2009 1:09 am Post subject: |
|
|
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 |
|
 |
svi
Joined: 09 Oct 2006 Posts: 236 Location: Finland
|
Posted: Sat Apr 25, 2009 5:53 pm Post subject: |
|
|
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
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 |
|
 |
Visioneer
Joined: 19 Nov 2007 Posts: 144
|
Posted: Mon Apr 27, 2009 11:15 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|