home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / mswindo / programm / misc / 1004 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  1.7 KB

  1. Path: sparky!uunet!gatech!news.byu.edu!yvax.byu.edu!cunyvm!m00bc
  2. Newsgroups: comp.os.ms-windows.programmer.misc
  3. Subject: Fonts question
  4. Message-ID: <92206.210733M00BC@CUNYVM.BITNET>
  5. From: Alex Vinogradov <M00BC@CUNYVM.BITNET>
  6. Date: Friday, 24 Jul 1992 21:07:33 EDT
  7. Organization: City University of New York/ University Computer Center
  8. Lines: 25
  9.  
  10. May be someone would be able to help me with the following problem (Microsoft
  11. technical support couldn't):
  12.  
  13. My application which uses the default SYSTEM font needs to create a dialog
  14. box which has to use MS Sans Serif font.  I specified Suns Serif in the .RC
  15. file and it worked fine for all predefined controls in the dialog box.  The
  16. problems began when I had to add a custom control to the dialog box.  I was
  17. hoping that if I would GetDC (hDlg), where hDlg is the handle to the dialog
  18. box window, I would get a device context with the Sans Serif font in it, but
  19. it wasn't the case: my device context had the default SYSTEM font in it.  I
  20. tried many different things, and the only one which appeared to work was
  21. using WM_GETFONT / WM_SETFONT message handling (and receiving hFont in
  22. wParam).  The problem with it though is that it gives me Sans Serif when I
  23. am converting hFont to logical font by using GetObject (), but when I am trying
  24. to SelectObject (hdc, hFont) and than GetTextMetrics (hdc, &tm), my tm
  25. structure still gets the SYSTEM font in it.
  26.  
  27. Did anyone had this problem ?  Did anyone found _any_ way to retreive the
  28. metrics of a font used by a dialog box ?
  29.  
  30. Any info is greatly appreciated.  Please reply via e-mail only to one of the
  31. following accounts:
  32.           m00bc@cunyvm.cuny.edu
  33.           alexv@bklyn.bitnet
  34.           alexv%bklyn@cunyvm.cuny.edu
  35.