home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4665 < prev    next >
Encoding:
Text File  |  1993-01-06  |  2.2 KB  |  47 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!sybus.sybus.com!myrddin!tct!jeff
  3. From: jeff@tct.com (Jeff Witzer)
  4. Subject: Circumnavigating Borland WM_CTLCOLOR trap...
  5. Message-ID: <2B4B58C2.180E@tct.com>
  6. Date: Wed, 6 Jan 1993 22:10:09 GMT
  7. Organization: TC Telemanagement, Clearwater, FL
  8. Lines: 37
  9.  
  10. If I understand it correctly, Borland style dialog controls do not receive 
  11. WM_CTLCOLOR messages.  I would like to know if there are, then, ways to 
  12. accomplish the following:
  13.  
  14. 1)  I would like to be able to change the color of text writen to the dialog
  15.     face.  I had hoped to use static controls but have found no way to change
  16.     the text color (no WM_CTLCOLOR messages).  I am currently using OWNERDRAW
  17.     controls and calling FillRect() to gray the background, SetTextColor() to
  18.     color the text, and DrawText() to display the text.  Since OWNERDRAW 
  19.     controls first clear to white, I am receiving a lot of flicker when I
  20.     update the screen.  Is there a better way to do this, or, at least, can I
  21.     get Windows to clear OWNERDRAW controls to gray?
  22.     
  23. 2)  I would like to be able to change the color of text written to a Borland 
  24.     style button's face (or change the button's face color) but, despite what
  25.     Petzold says, I don't receive a WM_CTLCOLOR message (thanks to Borland).
  26.     Is an OWNERDRAW button the best way to go?  I assume I would have to draw
  27.     the 3 dimentional shading (or does Windows do this for me?) and would have
  28.     to deal with the control going white as in problem #1.  Any advice?
  29.     
  30. 3)  (Unrelated to WM_CTLCOLOR)  First a warning...  What I am about to ask
  31.     goes against the basic purpose of Windows programming practices.  If you
  32.     have a weak stomach, do not read on.  What is the best way to have an
  33.     application completely take over the machine ...on purpose, I mean.  The
  34.     system I am writing is to be completely unstoppable due to its 
  35.     responsibilities.  It will be loaded and run from win.ini and Windows will
  36.     be started by autoexec.bat.  I would also like to be able to reboot the 
  37.     machine when the user attempts to close the application.  I believe I have
  38.     the code to do this.  Is there something I'm missing (besides common 
  39.     sense)?
  40.     
  41. Thanks,
  42.  
  43. jeff@tct.com    
  44.     
  45.     
  46.  
  47.