Jim.
========================================================================
OBRIEN...@YALE.EDU James A. O'Brien, Associate Professor
OBR...@MINERVA.CIS.YALE.EDU Dept. of Chem. Engrg., Yale University
OBRIEN@YALEMED P.O. Box 208286, New Haven CT 06520-8286
U.S.A. Tel: +1 203 432 4382 (days)
========================================================================
>I've written an app in which all of the dialogs, etc., use light rather than
>boldfaced fonts. I've got the common dialogs working like this too, using a
>hook function and EnumChildWindows. Is there any way I can force MessageBox
>to use my font, too?
Sure. Install a windows hook using SetWindowsHookEx. Select a type,
I think WH_MSGFILTER will do. In the hook, check that the message is
Dialog-related, and WM_INITDIALOG.
If so, find it's static. Send it a WM_SETFONT. I don't know whether the
messagebox will be rescaled, so you might be obliged to resize it yourself.
This works on all dialogs. To limit the reach to messageboxes only,
you have two approaches:
1. Using global vars, which you set/reset when doing messageboxes.
2. By building another test in the hook. The hInst of messageboxes
equals the hInst of USER.EXE (I think), and the hInst of dialogs
is whatever you supply. You can find the hInst of USER.EXE using
GetModuleHandle.
Hope this helps
--
Zweitze de Vries zwe...@et.tudelft.nl
Faculty of Electrotechnics
Delft University of Technology
Netherlands Never trust a virtual machine
NO ROM BASIC
SYSTEM HALTED
The system was completely locked up and a few seconds after that the
machine began to beep continuously and the only remaining option was to
do a hard reset.
I tried removing a variety of lines from the CONFIG.SYS and
AUTOEXEC.BAT files and various boards from the machine. Nothing worked
and as a consequence I am unable to make use of the debug versions of
Windows.
Does anyone recognize this problem or have an idea what is happening?
Does anyone know how to change the types of messages reported by the
debug version of Windows without actually having the debug version of
Windows running? If it is any help the machine uses the American
Megatrends, Inc. (AMI) BIOS.
>I've written an app in which all of the dialogs, etc., use light rather than
>boldfaced fonts. I've got the common dialogs working like this too, using a
>hook function and EnumChildWindows. Is there any way I can force MessageBox
>to use my font, too?
No.
Chris
--
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK | Author of SkyMap v2 shareware |
| Internet: ch...@chrism.demon.co.uk | astronomy program for Windows. |
| CompuServe: 100113,1140 | Mail me for details! |
| Author member of Association of Shareware Professionals (ASP) |
| Windows, C/C++ consultancy undertaken, anywhere in the world. |
--------------------------------------------------------------------------
>No.
I haven't tried this, but I think you could do it by responding to
WM_CTLCOLOR, which gets called for MessageBox (CTLCOLOR_MSGBOX) - since the
first one comes before it is drawn, why couldn't you do the WM_SETFONT at that
time? Just a WAG...
Later,
Kit Kauffmann ki...@mudshark.sunquest.com (Internet)
73363,447 (Compu$erve)
(801) 277-5790