Article View: comp.os.ms-windows.programmer.misc
Article #2533Circumnavigating Borland WM_CTLCOLOR trap...
From: Jeff Witzer
Date: Wed, 06 Jan 1993 22:10
Date: Wed, 06 Jan 1993 22:10
36 lines
2332 bytes
2332 bytes
If I understand it correctly, Borland style dialog controls do not receive
WM_CTLCOLOR messages. I would like to know if there are, then, ways to
accomplish the following:
1) I would like to be able to change the color of text writen to the dialog
face. I had hoped to use static controls but have found no way to change
the text color (no WM_CTLCOLOR messages). I am currently using OWNERDRAW
controls and calling FillRect() to gray the background, SetTextColor() to
color the text, and DrawText() to display the text. Since OWNERDRAW
controls first clear to white, I am receiving a lot of flicker when I
update the screen. Is there a better way to do this, or, at least, can I
get Windows to clear OWNERDRAW controls to gray?
2) I would like to be able to change the color of text written to a Borland
style button's face (or change the button's face color) but, despite what
Petzold says, I don't receive a WM_CTLCOLOR message (thanks to Borland).
Is an OWNERDRAW button the best way to go? I assume I would have to draw
the 3 dimentional shading (or does Windows do this for me?) and would have
to deal with the control going white as in problem #1. Any advice?
3) (Unrelated to WM_CTLCOLOR) First a warning... What I am about to ask
goes against the basic purpose of Windows programming practices. If you
have a weak stomach, do not read on. What is the best way to have an
application completely take over the machine ...on purpose, I mean. The
system I am writing is to be completely unstoppable due to its
responsibilities. It will be loaded and run from win.ini and Windows will
be started by autoexec.bat. I would also like to be able to reboot the
machine when the user attempts to close the application. I believe I have
the code to do this. Is there something I'm missing (besides common
sense)?
Thanks,
jeff@tct.com
Technical Details
Message-ID:
<2B4B58C2.180E@tct.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!sybus.sybus.com!myrddin!tct!jeffShow Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc Path: arc1-ca.pugleaf.net!sparky!uunet!sybus.sybus.com!myrddin!tct!jeff From: jeff@tct.com (Jeff Witzer) Subject: Circumnavigating Borland WM_CTLCOLOR trap... Message-ID: <2B4B58C2.180E@tct.com> Date: Wed, 6 Jan 1993 22:10:09 GMT Organization: TC Telemanagement, Clearwater, FL Lines: 37