Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MessageBox font?

15 views
Skip to first unread message

James A. O'Brien

unread,
Jul 26, 1994, 2:03:14 PM7/26/94
to
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?

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

Zweitze de Vries

unread,
Jul 27, 1994, 2:48:28 PM7/27/94
to
In article <obrien-james...@yale.edu>
obrien...@yale.edu (James A. O'Brien) writes:

>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

Colin Carpi

unread,
Jul 28, 1994, 2:41:24 PM7/28/94
to
Recenlty in an effort to debug a Windows application I switched
to the the debug version of Windows. I used DBWIN.EXE to view the
debug messages and to select which debug messages were output.
Initially only a few types of messages were output that were related
to memory management. But as those messages did not reveal the problem
more type of messages were added to the output. I do not remember
exactly which types of messages were added or in what order, but at
some point I exited out of Windows and then re-entered. The following
occurred. The Windows logo appeared, the screen went blank when the
video mode changed, the screen was repainted with the Windows
background color, the hard disk light flickered for a while then went
dead and finally a few seconds later the video mode changed to the old
DOS 320 bx 240 graphics mode and the following message was displayed.

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.

Chris Marriott

unread,
Jul 27, 1994, 1:46:02 PM7/27/94
to
In article <obrien-james...@yale.edu>

obrien...@yale.edu "James A. O'Brien" writes:

>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. |
--------------------------------------------------------------------------

Kit Kauffmann

unread,
Aug 1, 1994, 5:32:50 AM8/1/94
to

>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

0 new messages