ÓÑÇéÌáʾ£ºÈç¹û±¾ÍøÒ³´ò¿ªÌ«Âý»òÏÔʾ²»ÍêÕû£¬Çë³¢ÊÔÊó±êÓÒ¼ü¡°Ë¢Ð¡±±¾ÍøÒ³£¡
µÚÈýµç×ÓÊé ·µ»Ø±¾ÊéĿ¼ ¼ÓÈëÊéÇ© ÎÒµÄÊé¼Ü ÎÒµÄÊéÇ© TXTÈ«±¾ÏÂÔØ ¡ºÊղص½ÎÒµÄä¯ÀÀÆ÷¡»

CÓïÑÔʵÀý½Ì³Ì(PDF¸ñʽ)-µÚ64²¿·Ö

¿ì½Ý²Ù×÷: °´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³ °´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ °´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿! Èç¹û±¾ÊéûÓÐÔĶÁÍ꣬ÏëÏ´μÌÐø½Ó×ÅÔĶÁ£¬¿ÉʹÓÃÉÏ·½ "Êղص½ÎÒµÄä¯ÀÀÆ÷" ¹¦ÄÜ ºÍ "¼ÓÈëÊéÇ©" ¹¦ÄÜ£¡


¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡GetDeviceCaps£¨hDC£»¡¡LOGPIXELSY£©£»¡¡72£©£»¡¡¡¡



lfWidth£º¡¡¡¡¡¡¡¡¡¡¡¡ÒÔÂß¼­µ¥Î»Ö¸¶¨×ÖÌå×Ö·ûµÄƽ¾ù¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¿í¶È¡£Èç¹ûlfWidthµÄֵΪ0£¬Ôò¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¸ù¾ÝÉ豸µÄ×ݺá±È´Ó¿ÉÓÃ×ÖÌåµÄ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Êý×Öת»»×ݺáÖÐÑ¡È¡×î½Ó½üµÄÆ¥¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÅäÖµ£¬¸Ãֵͨ¹ý±È½ÏÁ½ÕßÖ®¼äµÄ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡²îÒìµÄ¾ø¶ÔÖµµÃ³ö¡£¡¡¡¡



lfEscapement£º¡¡¡¡ÒÔÊ®·ÖÖ®Ò»¶ÈΪµ¥Î»Ö¸¶¨Ã¿Ò»ÐС¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Îı¾Êä³öʱÏà¶ÔÓÚÒ³Ãæµ×¶ËµÄ½Ç¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶È¡£¡¡¡¡



ifOrientation£º¡¡¡¡ÒÔÊ®·ÖÖ®Ò»¶ÈΪµ¥Î»Ö¸¶¨×Ö·û»ù¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏßÏà¶ÔÓÚÒ³Ãæµ×¶ËµÄ½Ç¶È¡£¡¡¡¡



lfWeight£º¡¡¡¡¡¡¡¡¡¡Ö¸¶¨×ÖÌåÖØÁ¿¡£ÔÚWindowsÖУ¬×Ö¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÌåÖØÁ¿Õâ¸öÊõÓïÓÃÀ´Ö¸´ú×ÖÌåµÄ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡´Öϸ³Ì¶È¡£lfWeightµÄ·¶Î§Îª0µ½¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡1000£¬Õý³£Çé¿öϵÄ×ÖÌåÖØÁ¿Îª¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡400£¬´ÖÌåΪ700¡£Èç¹ûlfWeight¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Îª0£¬ÔòʹÓÃĬÈϵÄ×ÖÌåÖØÁ¿¡£¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡552¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

lfItalic£º¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡µ±lfItalicΪTRUEʱʹÓÃбÌå¡¡¡¡



lfUnderline£º¡¡¡¡¡¡¡¡¡¡µ±lfUnderlineΪTRUEʱ¸ø×ÖÌåÌí¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¼ÓÏ»®Ïß¡¡¡¡



lfStrikeOut£º¡¡¡¡¡¡¡¡¡¡µ±lfStrikeOutΪTRUEʱ¸ø×ÖÌåÌí¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¼Óɾ³ýÏß¡¡¡¡



lfCharSet£º¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ö¸¶¨×Ö·û¼¯¡£¿ÉÒÔʹÓÃÏÂÃæµÄÔ¤¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶¨ÒåÖµ£º¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ANSI_CHARSET¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡OEM_CHARSET¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡SYMBOL_CHARSET¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡UNICODE_CHARSET¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÆäÖÐOEM×Ö·û¼¯ÊÇÓë²Ù×÷ϵͳÏà¹Ø¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡µÄ¡£¡¡¡¡



lfOutPrecision£º¡¡¡¡Ö¸¶¨Êä³ö¾«¶È¡£Êä³ö¾«¶È¶¨ÒåÁË¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Êä³öÓëËùÒªÇóµÄ×ÖÌå¸ß¶È¡¢¿í¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶È¡¢×Ö·û·½ÏòµÈµÄ½Ó½ü³Ì¶È¡£Ëü¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¿ÉÒÔΪÏÂÃæµÄÖµÖ®Ò»£º¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡OUT_CHARACTER_PRECIS¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡OUT_DEFAULT_PRECIS¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡OUT_STRING_PRECIS¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡OUT_STROKE_PRECIS¡¡¡¡



lfClipPrecision£º¡¡¡¡Ö¸¶¨¼ô¼­¾«¶È¡£¼ô¼­¾«¶È¶¨ÒåÁË¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡µ±×Ö·ûµÄÒ»²¿·Ö³¬¹ý¼ô¼­ÇøÓòʱ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶Ô×Ö·ûµÄ¼ô¼­·½Ê½£¬Ëü¿ÉÒÔΪÏ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÁÐÖµÖ®Ò»£º¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CLIP_CHARACTER_PRECIS¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CLIP_DEFAULT_PRECIS¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡553¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CLIP_STROKE_PRECIS¡¡¡¡



lfQuality£º¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶¨ÒåÊä³öÖÊÁ¿¡£Êä³öÖÊÁ¿¶¨ÒåÁË¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Í¼ÐÎÉ豸½Ó¿ÚÔÚÆ¥ÅäÂß¼­×ÖÌåÊô¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÐÔµ½Êµ¼ÊµÄÎïÀí×ÖÌåµÄËùʹÓõġ¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·½Ê½£¬Ëü¿ÉÒÔΪÏÂÁÐÖµÖ®Ò»£º¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DEFAULT_QUALITY¡¡£¨Ä¬ÈÏÖÊÁ¿£©¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DRAFT_QUALITY¡¡£¨²Ý¸åÖÊÁ¿£©¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡PROOF_QUALITY¡¡£¨Õý¸åÖÊÁ¿£©¡¡¡¡



lfPitchAndFamily£º¡¡¡¡Ö¸¶¨×ÖÌåµÄ×Ö·û¼ä¾àºÍ×å¡£×îµÍ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Á½Î»Ö¸¶¨×ÖÌåµÄ×Ö·û¼ä¾àΪÒÔÏ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÖµÖ®Ò»£º¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DEFAULT_PITCH¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡FIXED_PITCH¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡VARIABLE_PITCH¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡µÚ4µ½7λָ¶¨×ÖÌå×åΪÒÔÏÂÖµÖ®¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ò»£º¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡FF_DECORATIVE¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡FF_DONTCARE¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡FF_MODERN¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡FF_ROMAN¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡FF_SCRIPT¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡FF_SWISS¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÕâЩֵµÄ¾ßÌ庬Òå¿ÉÒԲο¼¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Visual¡¡¡¡C£«£«ÖйØÓڽṹLOGFONTµÄ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Îĵµ¡£¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡×Ö·û¼ä¾àºÍ×ÖÌå×å¿ÉÒÔʹÓÃÂß¼­¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡554¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡»ò£¨OR£©ÔËËã·ûÀ´½øÐÐ×éºÏ¡£¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lfFaceName£º¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ò»¸öÖ¸¶¨ÒÔNULL½áβµÄ×Ö·û´®µÄ¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ö¸Õ룬ËüÖ¸¶¨µÄËùÓõÄ×ÖÌåÃû¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¸Ã×Ö·û´®µÄ³¤¶È²»µÃ³¬¹ý32¸ö×Ö¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·û£¬Èç¹ûlfFaceNameΪNULL£¬Í¼¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÐÎÉ豸½Ó¿Ú½«Ê¹ÓÃĬÈϵÄ×ÖÌå¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ãû¡£¡¡¡¡



9¡£4¡£3¡¡Ê¹ÓÃ×ÖÌå¶ÔÏóºÍö¾ÙϵͳÖеÄËùÓÐ×ÖÌå¡¡¡¡



ʾÀý³ÌÐòFontDemoÑÝʾÁËLOGFONT½á¹¹ºÍCFont¶ÔÏóµÄʹÓᣴËÍ⣬ÔÚ¡¡

¸ÃʾÀý³ÌÐòÖУ¬ÎÒÃÇ»¹ÑÝʾÁËÈçºÎ»ñµÃµ±Ç°ÏµÍ³ÖÐÒÑ°²×°µÄËùÓпÉÓá¡

×ÖÌ壬ÕâЩÐÅÏ¢ÊÇͨ¹ýAPIº¯ÊýEnumFontFamiliesºÍ×Ô¶¨ÒåµÄ×ÖÌåö¡¡

¾Ù»Øµ÷º¯ÊýEnumFontFamProcÀ´µÃµ½£¬²¢·ÅÈë³ÌÐòÖ÷´°¿ÚÄÚµÄÁбí¿ò¡¡

Öеġ£¡¡¡¡



#include¡¡¡¡¡¡



#include¡¡¡¡¡¡



#include¡¡¡¡¡¡



#define¡¡DegToRnd£¨x£©¡¡£¨x/180¡£*3¡£14159£©¡¡¡¡



int¡¡WINAPI¡¡EnumFontFamProc£¨const¡¡LOGFONTA¡¡*lplf£»¡¡¡¡¡¡



const¡¡TEXTMETRICA¡¡*lptm£»¡¡unsigned¡¡long¡¡FontType£»¡¡LPARAM¡¡lParam£©£»¡¡¡¡



//¡¡ÅÉÉúÓ¦ÓóÌÐòÀà¡¡¡¡



class¡¡CMyApp¡¡£º¡¡public¡¡CWinApp¡¡¡¡



£û¡¡¡¡



public£º¡¡¡¡



virtual¡¡BOOL¡¡InitInstance£¨£©£»¡¡¡¡



£ý£»¡¡¡¡



//¡¡ÅÉÉú´°¿ÚÀà¡¡¡¡



class¡¡CMyWnd¡¡£º¡¡public¡¡CFrameWnd¡¡¡¡



£û¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡555¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

public£º¡¡¡¡



CListBox¡¡lst£»¡¡¡¡



protected£º¡¡¡¡



//¡¡ÉùÃ÷ÏûÏ¢´¦Àíº¯Êý¡¡¡¡



afx_msg¡¡void¡¡OnPaint£¨£©£»¡¡¡¡



afx_msg¡¡int¡¡OnCreate£¨LPCREATESTRUCT¡¡lpCreateStruct£©£»¡¡¡¡



DECLARE_MESSAGE_MAP£¨£©£»¡¡¡¡



£ý£»¡¡¡¡



//¡¡³õʼ»¯Ó¦ÓóÌÐòʵÀý¡¡¡¡



BOOL¡¡CMyApp£º£ºInitInstance£¨£©¡¡¡¡



£û¡¡¡¡



//¡¡´´½¨Ó¦ÓóÌÐòµÄÖ÷´°¿Ú¡¡¡¡



CMyWnd¡¡*pWnd=new¡¡CMyWnd£»¡¡¡¡



pWnd¡­¡·Create£¨NULL£»¡¡¡¨×ÖÌåʾÀý¡¨£©£»¡¡¡¡



//¡¡ÏÔʾӦÓóÌÐòÖ÷´°¿Ú²¢Ë¢ÐÂÆä¿Í»§Çø¡¡¡¡



pWnd¡­¡·ShowWindow£¨SW_SHOW£©£»¡¡¡¡



pWnd¡­¡·UpdateWindow£¨£©£»¡¡¡¡



//¡¡ÔÚÖ÷´°¿Ú¹Ø±ÕʱÖÕÖ¹Ó¦ÓóÌÐòµÄÖ´ÐÐÏ̡߳¡¡¡



m_pMainWnd=pWnd£»¡¡¡¡



return¡¡TRUE£»¡¡¡¡



£ý¡¡¡¡



//¡¡ÉùÃ÷ΨһµÄÓ¦ÓóÌÐò¶ÔÏó¡¡¡¡



CMyApp¡¡MyApp£»¡¡¡¡



//¡¡Ó¦ÓóÌÐòÖ÷´°¿ÚµÄÏûÏ¢Ó³Éä¡¡¡¡



BEGIN_MESSAGE_MAP£¨CMyWnd£»¡¡CWnd£©¡¡¡¡



ON_WM_CREATE£¨£©¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡556¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

ON_WM_PAINT£¨£©¡¡¡¡



END_MESSAGE_MAP£¨£©¡¡¡¡



//¡¡Ó¦ÓóÌÐòÖ÷´°¿ÚµÄÖػ溯Êý¡¡¡¡



void¡¡CMyWnd£º£ºOnPaint£¨£©¡¡¡¡



£û¡¡¡¡



//¡¡»ñµÃ´°¿ÚµÄ¿Í»§ÇøÉ豸ÉÏÏÂÎľä±ú¡¡¡¡



CPaintDC¡¡dc£¨this£©£»¡¡¡¡



//¡¡ÉèÖÃ×ÖÌåÊä³ö±³¾°ÎªÍ¸Ã÷¡¡¡¡



dc¡£SetBkMode£¨TRANSPARENT£©£»¡¡¡¡



//¡¡»ñµÃÉ豸ÉÏÏÂÎÄËùʹÓõĵ±Ç°×ÖÌå¡¡¡¡



LOGFONT¡¡lf£»¡¡¡¡



dc¡£GetCurrentFont£¨£©¡­¡·GetLogFont£¨&lf£©£»¡¡¡¡



CFont¡¡font1£»¡¡font2£»¡¡¡¡



CFont¡¡*pOldFont£»¡¡//¡¡±£´æÉ豸ÉÏÏÂÎÄ×î³õʹÓõÄ×ÖÌå¶ÔÏó¡¡¡¡



//¡¡´´½¨¡¡font1¡¡Îª¡¡12¡¡ÏóËØËÎÌå¡¡¡¡



lf¡£lfCharSet=134£»¡¡¡¡



lf¡£lfHeight=¡­12£»¡¡¡¡



lf¡£lfWidth=0£»¡¡¡¡



strcpy£¨lf¡£lfFaceName£»¡¡¡¨ËÎÌ塨£©£»¡¡¡¡



font1¡£CreateFontIndirect£¨&lf£©£»¡¡¡¡



//¡¡¸ü¸Äµ±Ç°×ÖÌåΪ¡¡20¡¡ÏóËصġ¡Times¡¡New¡¡Roman£¬²¢ÇÒÏòÉÏÇãб¡¡40¡¡¶È¡¡¡¡



lf¡£lfCharSet=0£»¡¡¡¡



strcpy£¨lf¡£lfFaceName£»¡¡¡¨Times¡¡New¡¡Roman¡¨£©£»¡¡¡¡



lf¡£lfEscapement=400£»¡¡¡¡



lf¡£lfHeight=¡­20£»¡¡¡¡



font2¡£CreateFontIndirect£¨&lf£©£»¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡557¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

pOldFont=dc¡£SelectObject£¨&font2£©£»¡¡¡¡



//¡¡»ñµÃ×Ö·û´®¡¡¡¨lfEscapement=¡¡400¡¨¡¡ÔÚÊä³öʱµÄ¿í¶ÈºÍ¸ß¶È¡¡¡¡



CSize¡¡sz=dc¡£GetTextExtent£¨¡¨lfEscapement=¡¡400¡¨£©£»¡¡¡¡



//¡¡¼ÆËã×Ö·û´®ºÏÊʵÄÊä³öλÖá¡¡¡



dc¡£TextOut£¨10£»¡¡10£«int£¨sz¡£cx*sin£¨DegToRnd£¨40£©£©£©£»¡¡¡¨lfEscapement=¡¡400¡¨£©£»¡¡¡¡



//¡¡½«×ÖÌåÊä³ö·½Ïò¸ü¸ÄΪÏòÏÂÇãб¡¡40¡¡¶È¡¡¡¡



lf¡£lfEscapement=¡­400£»¡¡¡¡



dc¡£SelectObject£¨pOldFont£©£»¡¡¡¡



font2¡£DeleteObject£¨£©£»¡¡¡¡



font2¡£CreateFontIndirect£¨&lf£©£»¡¡¡¡



dc¡£SelectObject£¨&font2£©£»¡¡¡¡



//¡¡¼ÆËã×Ö·û´®ºÏÊʵÄÊä³öλÖá¡¡¡



dc¡£TextOut£¨290¡­int£¨sz¡£cx*cos£¨DegToRnd£¨40£©£©£©£»¡¡10£»¡¡¡¨lfEscapement=¡­400¡¨£©£»¡¡¡¡



//¡¡½«×ÖÌåÊä³ö·½Ïò¸ü¸ÄΪˮƽ·½Ïò¡¡¡¡



lf¡£lfEscapement=0£»¡¡¡¡



dc¡£SelectObject£¨pOldFont£©£»¡¡¡¡



font2¡£DeleteObject£¨£©£»¡¡¡¡



font2¡£CreateFontIndirect£¨&lf£©£»¡¡¡¡



dc¡£SelectObject£¨&font2£©£»¡¡¡¡



//¡¡¶Ô³ÆÓÚÖ±Ïß¡¡x=150¡¡Êä³ö×Ö·û´®¡¡¡¨lfEscapement=0¡¨¡¡¡¡



sz=dc¡£GetTextExtent£¨¡¨lfEscapement=0¡¨£©£»¡¡¡¡



dc¡£TextOut£¨150¡­sz¡£cx/2£»¡¡110£»¡¡¡¨lfEscapement=0¡¨£©£»¡¡¡¡



//¡¡¸ü¸Äµ±Ç°×ÖÌåΪ×îϸµÄ¡¡50¡¡ÏóËØ´óСµÄËÎÌå¡¡¡¡



lf¡£lfCharSet=134£»¡¡¡¡



strcpy£¨lf¡£lfFaceName£»¡¡¡¨ËÎÌ塨£©£»¡¡¡¡



lf¡£lfEscapement=0£»¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡558¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

lf¡£lfWeight=0£»¡¡¡¡



lf¡£lfHeight=¡­50£»¡¡¡¡



dc¡£SelectObject£¨pOldFont£©£»¡¡¡¡



font2¡£DeleteObject£¨£©£»¡¡¡¡



font2¡£CreateFontIndirect£¨&lf£©£»¡¡¡¡



dc¡£SelectObject£¨&font2£©£»¡¡¡¡



//¡¡Êä³öÒ»¸ö¡¡¡¨Ï¸¡¨¡¡×Ö¡¡¡¡



dc¡£TextOut£¨330£»¡¡10£»¡¡¡¨Ï¸¡¨£©£»¡¡¡¡



//¡¡ÔÚÅÔ±ßʹÓá¡12¡¡ÏóËØ´óСµÄËÎÌå×Ö¸ø³öµ±Ç°×ÖÌåµÄÖØÁ¿¡¡¡¡



dc¡£SelectObject£¨&font1£©£»¡¡¡¡



dc¡£TextOut£¨395£»¡¡29£»¡¡¡¨lfWeight=0¡¨£©£»¡¡¡¡



//¡¡¸ü¸Äµ±Ç°×ÖÌåΪ×î´ÖµÄ¡¡50¡¡ÏóËØ´óСµÄ×ÖÌå¡¡¡¡



lf¡£lfWeight=1000£»¡¡¡¡



dc¡£SelectObject£¨pOldFont£©£»¡¡¡¡



font2¡£DeleteObject£¨£©£»¡¡¡¡



font2¡£CreateFontIndirect£¨&lf£©£»¡¡¡¡



dc¡£SelectObject£¨&font2£©£»¡¡¡¡



//¡¡Êä³öÒ»¸ö¡¡¡¨´Ö¡¨¡¡×Ö¡¡¡¡



dc¡£TextOut£¨330£»¡¡80£»¡¡¡¨´Ö¡¨£©£»¡¡¡¡



dc¡£SelectObject£¨&font1£©£»¡¡¡¡



//¡¡ÔÚÅÔ±ßʹÓá¡12¡¡ÏóËØ´óСµÄËÎÌå×Ö¸ø³öµ±Ç°×ÖÌåºÍÖØÁ¿¡¡¡¡



dc¡£TextOut£¨395£»¡¡99£»¡¡¡¨lfWeight=1000¡¨£©£»¡¡¡¡



//¡¡»Ö¸´É豸ÉÏÏÂÎÄÔ­Óеġ¡GDI¡¡»æͼ¶ÔÏó¡¡¡¡



dc¡£SelectObject£¨pOldFont£©£»¡¡¡¡



£ý¡¡¡¡



//¡¡Ö÷´°¿ÚµÄ¡¡WM_CREATE¡¡ÏûÏ¢µÄ´¦Àíº¯Êý¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡559¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

int¡¡CMyWnd£º£ºOnCreate£¨LPCREATESTRUCT¡¡lpCreateStruct£©¡¡¡¡



£û¡¡¡¡



//¡¡µ÷ÓûùÀàµÄĬÈÏÏûÏ¢´¦Àíº¯Êý¡¡¡¡



int¡¡iResult=CWnd£º£ºOnCreate£¨lpCreateStruct£©£»¡¡¡¡



//¡¡´´½¨Ò»¸öÁбí¿ò£¬¸ÃÁбí¿òÖиø³öÁ˵±Ç°ÏµÍ³Öа²×°µÄËùÓпÉÓÃ×ÖÌå¡¡¡¡



lst¡£Create£¨LBS_STANDARD¡¡£ü¡¡LBS_USETABSTOPS¡¡£ü¡¡WS_CHILD¡¡£ü¡¡WS_VISIBLE£»¡¡¡¡¡¡



CRect£¨10£»¡¡150£»¡¡480£»¡¡350£©£»¡¡this£»¡¡1001£©£»¡¡¡¡



//¡¡¸ü¸ÄÁбí¿òËùÓõÄ×ÖÌåΪ¡¡9¡¡°õ¡¡£¨12¡¡ÏóËØ£©¡¡´óСµÄËÎÌå¡¡¡¡



static¡¡CFont¡¡font£»¡¡¡¡



font¡£CreatePointFont£¨90£»¡¡¡¨ËÎÌ塨£©£»¡¡¡¡



lst¡£SetFont£¨&font£©£»¡¡¡¡



//¡¡ÉèÖÃÁбí¿òµÄÖƱí·ûλÖÃΪ¡¡200¡¡¸ö¶Ô»°¿òµ¥Î»¡¡¡¡



lst¡£SetTabStops£¨200£©£»¡¡¡¡



//¡¡Ã¶¾Ùµ±Ç°ÏµÍ³µÄËùÓпÉÓÃ×ÖÌ壬½«Ö¸ÏòÁбí¿òµÄ¡¡CListBox¡¡¶ÔÏóµÄÖ¸Õë×÷ΪӦÓóÌÐòÌṩ¡¡

µÄ¡¡¡¡



//¡¡²ÎÊý´«µÝ¸øö¾Ù×ÖÌå»Øµ÷º¯Êý¡¡EnumFontFamProc¡¡¡¡



EnumFontFamilies£¨£º£ºGetDC£¨GetSafeHwnd£¨£©£©£»¡¡NULL£»¡¡EnumFontFamProc£»¡¡£¨LPARAM£©£¨&lst£©£©£»¡¡¡¡



return¡¡iResult£»¡¡¡¡



£ý¡¡¡¡



//¡¡Ã¶¾Ù×ÖÌåʱµÄ»Øµ÷º¯Êý£¬¸Ãº¯Êý½«ÏµÍ³µÄËùÓпÉÓÃ×ÖÌå¼°Æä×Ö·û¼¯Ìí¼Óµ½Áбí¿òÖУ¬¡¡¡¡



//¡¡ÓÉÓ¦ÓóÌÐòÌṩµÄ²ÎÊý¡¡lParam¡¡ÌṩÁËÖ¸Ïò¸ÃÁбí¿òµÄ¡¡CListBox¡¡¶ÔÏóµÄÖ¸Õë¡¡¡¡



int¡¡WINAPI¡¡EnumFontFamProc£¨const¡¡LOGFONTA¡¡*¡¡lplf£»¡¡¡¡¡¡



const¡¡TEXTMETRICA¡¡*lptm£»¡¡unsigned¡¡long¡¡FontType£»¡¡LPARAM¡¡lParam£©¡¡¡¡



£û¡¡¡¡



CListBox¡¡*pList=£¨CListBox*£©lParam£»¡¡¡¡



CString¡¡str£»¡¡¡¡



//¡¡½«µ±Ç°×ÖÌåµÄ×ÖÌåÃû¡¡¡¡£¨FaceName£©¡¡ºÍ×Ö·û¼¯¡¡¡¡£¨CharSet£©¡¡Ìí¼Óµ½Áбí¿òÖС¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡560¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

str¡£Format£¨¡¨FACENAME£º¡¡£¥s¡¡tCHARSET£º¡¡£¥d¡¨£»¡¡lplf¡­¡·lfFaceName£»¡¡lplf¡­¡·lfCharSet£©£»¡¡¡¡



pList¡­¡·AddString£¨str£©£»¡¡¡¡



return¡¡TRUE£»¡¡//¡¡·µ»Ø¡¡TRUE¡¡ÒÔ¼ÌÐø×ÖÌåö¾ÙµÄ¹ý³Ì£¬·µ»Ø¡¡FALSE¡¡½«ÖÕÖ¹×ÖÌåö¾ÙµÄ¹ý³Ì¡¡¡¡



£ý¡¡¡¡



ÎÒÃÇÏÈÀ´¿´ÖØ»æÏûÏ¢´¦Àíº¯ÊýOnPaint£¬Ò»¿ªÊ¼Ê±£¬ÎÒÃǵ÷ÓÃÁËCDCÀà¡¡

µÄ³ÉÔ±º¯ÊýGetCurrentFont£¬¸Ã³ÉÔ±º¯Êý·µ»Øµ±Ç°É豸ÉÏÏÂÎÄËùʹÓá¡

µÄ×ÖÌ壬Æä·µ»ØÖµÊÇÒ»¸öÖ¸ÏòCFont¶ÔÏóµÄÖ¸Õ룬Ȼºó£¬ÎÒÃÇͨ¹ý¸Ã¡¡

Ö¸Õëµ÷ÓÃCFontÀàµÄ³ÉÔ±º¯ÊýGetLogFont£¬¸Ã³ÉÔ±º¯Êý½«×ÖÌåµÄÐÅÏ¢¡¡

ÌîÈëµ½Ò»¸öLOGFONT½á¹¹ÖС£ÔÚÏÂÃæµÄ²½ÖèÖУ¬ÎÒÃÇͨ¹ýÐ޸ĸýṹ¡¡

µÄ³ÉÔ±À´´´½¨ÐµÄ×ÖÌå¶ÔÏó¡£Ê×ÏÈ£¬ÎÒÃÇ´´½¨Ò»¸öCFont¶ÔÏófont1£¬¡¡

font1ʹÓÃÁË12¸öÏóËØ´óСµÄËÎÌå×Ö£¬ÔÚ³ÌÐòÖÐËüÖ÷ÒªÓÃÀ´Êä³öһЩ¡¡

±êʶÎı¾¡£ÕâÀÎÒÃÇÏÈÔÚLOGFONT½á¹¹¶ÔÏólfÔÚÏà¹Ø³ÉÔ±ÖÐÌîÈëС¡

µÄÖµ£¬ÔÙÒԸýṹ¶ÔÏóΪ²ÎÊýÀ´µ÷ÓÃCFontÀàµÄ³ÉÔ±º¯Êý¡¡

CreateFontIndirect´´½¨ÏàÓ¦µÄGDI×ÖÌå¶ÔÏó¡£ÕâÀïÎÒÃǽ«lfCharSet¡¡

³ÉÔ±ÐÞ¸ÄΪ134¡¡¡¡¡¡£¬Õâ¸öÖµ¿ÉÒÔͨ¹ý±¾³ÌÐòµÄÔËÐнá¹ûµÃ³ö£¬lfWidth¡¡

³ÉÔ±ÐÞ¸ÄΪ0£¬ÕâÑù½«Ê¹ÓÃĬÈϵÄ×Ö·û×ݺá±ÈµÃµ½×Ö·ûµÄ¿í¶È¡£¡¡¡¡



ÔÚÏÂÃæ¹ý³ÌÖУ¬ÎÒÃÇ°´ÕÕÀàËƵķ½·¨´´½¨Ò»´óСΪ20¸öÏóËصÄTimes¡¡¡¡

New¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Roman×ÖÌ壬Óë¸Õ²Å²»Í¬µÄÊÇ£¬ÎÒÃǽ«½á¹¹¶ÔÏólfµÄ¡¡

lfEscapement³ÉÔ±µÄÖµÉèÖÃΪ400£¬ÕâÑù£¬Îı¾½«ÒÔÏòÉÏÇãб40¶È¡¡

£¨lfEscapementµÄÖµµÄµ¥Î»Îª1/10¶È£©µÄ½Ç¶È½øÐÐÊä³ö¡£½Ó×Å£¬ÎÒÃǽ«¡¡

¸Ã×ÖÌå¶ÔÏ
·µ»ØĿ¼ ÉÏÒ»Ò³ ÏÂÒ»Ò³ »Øµ½¶¥²¿ ÔÞ£¨1£© ²È£¨1£©
¿ì½Ý²Ù×÷: °´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³ °´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ °´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿!
ÎÂÜ°Ìáʾ£º ο´Ð¡ËµµÄͬʱ·¢±íÆÀÂÛ£¬Ëµ³ö×Ô¼ºµÄ¿´·¨ºÍÆäËüС»ï°éÃÇ·ÖÏíÒ²²»´íŶ£¡·¢±íÊéÆÀ»¹¿ÉÒÔ»ñµÃ»ý·ÖºÍ¾­Ñé½±Àø£¬ÈÏÕæдԭ´´ÊéÆÀ ±»²ÉÄÉΪ¾«ÆÀ¿ÉÒÔ»ñµÃ´óÁ¿½ð±Ò¡¢»ý·ÖºÍ¾­Ñé½±ÀøŶ£¡