ÓÑÇéÌáʾ£ºÈç¹û±¾ÍøÒ³´ò¿ªÌ«Âý»òÏÔʾ²»ÍêÕû£¬Çë³¢ÊÔÊó±êÓÒ¼ü¡°Ë¢Ð¡±±¾ÍøÒ³£¡ÔĶÁ¹ý³Ì·¢ÏÖÈκδíÎóÇë¸æËßÎÒÃÇ£¬Ð»Ð»£¡£¡ ±¨¸æ´íÎó
ÒÀÒÀС˵ ·µ»Ø±¾ÊéĿ¼ ÎÒµÄÊé¼Ü ÎÒµÄÊéÇ© TXTÈ«±¾ÏÂÔØ ½øÈëÊé°É ¼ÓÈëÊéÇ©

windows»·¾³ÏÂ32λ»ã±àÓïÑÔ³ÌÐòÉè¼Æ-µÚ64²¿·Ö

°´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³£¬°´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ£¬°´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿£¡
¡ª¡ª¡ª¡ªÎ´ÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡




ÒªÉèÖÃÎı¾¸ñʽ¿ÉÒÔͨ¹ý·¢ËÍEM_SETCHARFORMATÏûÏ¢£¬Õâ¸öÏûÏ¢ÉèÖÿؼþÖÐÒ»¶ÎÑ¡¶¨µÄÎı¾»òÕßÈ«²¿ÕýÎĵĸñʽ£¬ÏûÏ¢µÄÓ÷¨ÈçÏ£º

invoke¡¡¡¡SendMessage£»hWinEdit£»EM_SETCHARFORMAT£»uFlags£»lpFmt

uFlags²ÎÊý±íʾָ¶¨µÄ¸ñʽËùÓ¦Óõķ¶Î§£¬Ëü¿ÉÒÔÊÇÏÂÃæµÄÊýÖµ¡£

¡ñ¡¡¡¡¡¡SCF_ALL¡ª¡ªÎª¿Ø¼þÖеÄÈ«²¿Îı¾ÉèÖÃÖ¸¶¨µÄ¸ñʽ¡£

¡ñ¡¡¡¡¡¡SCF_SELECTION¡ª¡ª½öΪѡÔñÇøÓòÉèÖÃÖ¸¶¨µÄ¸ñʽ£¬Èç¹ûÑ¡ÔñÇøÓòΪ¿Õ£¬ÔòÒÔºóÔÚ´ËλÖòåÈëµÄÐÂ×Ö·ûʹÓô˸ñʽ¡£

¡ñ¡¡¡¡¡¡SCF_WORD¡¡ÓëSCF_SELECTION¡ª¡ª½«¸ñʽӦÓõ½Ñ¡¶¨µÄµ¥´ÊÉÏ£¬Èç¹ûÑ¡ÔñÇøÓòûÓÐÂäÔÚÕû¸öµ¥´ÊÉÏ£¬ÄÇô¸ñʽ»áÀ©Õ¹µ½Õû¸öµ¥´ÊÉÏ£¬SCF_WORD±êÖ¾±ØÐëºÍSCF_SELECTION±êÖ¾Ò»ÆðʹÓá£

lpFmt²ÎÊýÔòÖ¸ÏòÒ»¸öCHARFORMAT»òCHARFORMAT2½á¹¹£¬CHARFORMAT½á¹¹¿ÉÒÔÔÚËùÓа汾ÖÐʹÓ㬶øCHARFORMAT2½á¹¹½ö¿ÉÒÔÔÚ2¡£0¼°ÒÔÉϰ汾ʹÓã¬CHARFORMAT2½á¹¹ÊÇCHARFORMAT½á¹¹µÄÀ©Õ¹£¬ÏÂÃæÊÇCHARFORMAT2½á¹¹µÄ¶¨Ò壺

CHARFORMAT2¡¡STRUCT

¡¡¡¡CbSize¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»½á¹¹³¤¶È

¡¡¡¡dwMask¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»×Ö¶ÎÑÚÂë

¡¡¡¡dwEffects¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»ÎÄ×ÖЧ¹û

¡¡¡¡yHeight¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»ÎÄ×ָ߶È

¡¡¡¡yOffset¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡crTextColor¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»Îı¾ÑÕÉ«

¡¡¡¡bCharSet¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡BYTE¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡bPitchAndFamily¡¡¡¡¡¡BYTE¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡szFaceName¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡BYTE¡¡LF_FACESIZE¡¡dup£¨£¿£©¡¡£»×ÖÌåÃû³Æ

£»CHARFORMAT½á¹¹µÄ¶¨Òåµ½´ËΪֹ

¡¡¡¡wWeight¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡WORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡sSpacing¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡WORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡crBackColor¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡lcid¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡dwReserved¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡sStyle¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡WORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡wKerning¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡WORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡bUnderlineType¡¡¡¡¡¡¡¡BYTE¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡bAnimation¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡BYTE¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡

¡¡¡¡bRevAuthor¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡BYTE¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

¡¡¡¡bReserved1¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡BYTE¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿

CHARFORMAT2¡¡ENDS

CHARFORMAT2½á¹¹ÖÐszFaceName×Ö¶ÎÒÔÇ°µÄÄÚÈݾÍÊÇCHARFORMAT½á¹¹£¬½á¹¹Öи÷×ֶεĺ¬ÒåÈçÏ¡£

¡ñ¡¡¡¡¡¡cbSize¡ª¡ª½á¹¹µÄ´óС£¬¿Ø¼þʹÓøÃ×Ö¶ÎÀ´ÅжϽṹµÄ°æ±¾ÊÇCHARFORMAT»¹ÊÇ¡¡CHARFORMAT2£¬ËùÒÔÔÚ½«½á¹¹´«µÝ¸ø¿Ø¼þÇ°±ØÐ뽫Õâ¸ö×Ö¶ÎÉèÖÃΪÕýÈ·µÄÊýÖµ¡£

¡ñ¡¡¡¡¡¡dwMask¡ª¡ª×Ö¶ÎÑÚÂ룬ÓÃÀ´Ö¸¶¨½á¹¹ÖÐÄÄЩ×Ö¶ÎÊÇÓÐЧµÄ£¬Èç¹ûûÓÐʹÓöÔÓ¦µÄ±êÖ¾£¬¼´Ê¹Ä³Ð©×ֶεÄÄÚÈݱ»ÉèÖ㬿ؼþÒ²²»»áʹÓÃËü£¬dwMaskÖпÉÒÔʹÓõıêÖ¾¿ÉÒÔÊÇÏÂÃæÊýÖµµÄ×éºÏ£º

¡ö¡¡¡¡¡¡CFM_BOLD¡ª¡ªdwEffects×Ö¶ÎÖÐCFE_BOLD¡¡ÖµÊÇÓÐЧµÄ¡£

¡ö¡¡¡¡¡¡CFM_CHARSET¡ª¡ªbCharSet×Ö¶ÎÊÇÓÐЧµÄ¡£

¡ö¡¡¡¡¡¡CFM_COLOR¡ª¡ªcrTextColor×ֶκÍdwEffectsÖеġ¡CFE_AUTOCOLOR¡¡ÖµÊÇÓÐЧµÄ¡£

¡ö¡¡¡¡¡¡CFM_FACE¡ª¡ªszFaceName×ֶεÄÖµÊÇÓÐЧµÄ¡£

¡ö¡¡¡¡¡¡CFM_ITALIC¡ª¡ªdwEffects×Ö¶ÎÖеÄCFE_ITALICÖµÊÇÓÐЧµÄ¡£

¡ö¡¡¡¡¡¡CFM_OFFSET¡ª¡ªyOffset×Ö¶ÎÊÇÓÐЧµÄ¡£

¡ö¡¡¡¡¡¡CFM_PROTECTED¡ª¡ªdwEffects×Ö¶ÎÖеÄCFE_PROTECTEDÖµÊÇÓÐЧµÄ¡£

¡ö¡¡¡¡¡¡CFM_SIZE¡ª¡ªyHeight×Ö¶ÎÊÇÓÐЧµÄ¡£



¡¡
À´Ô´£ºµç×Ó¹¤Òµ³ö°æÉç¡¡×÷ÕߣºÂÞÔƱò¡¡ÉÏÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡»ØÊéÄ¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏÂÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ÉÏÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡»ØÊéÄ¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏÂÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡


µÚ9Õ¡¡Í¨Óÿؼþ


9¡£4¡¡Ê¹ÓÃRichedit¿Ø¼þ£¨8£©

¡¡¡¡¡¡¡¡
¡ö¡¡¡¡¡¡CFM_STRIKEOUT¡ª¡ªdwEffects×Ö¶ÎÖеÄCFE_STRIKEOUTÖµÊÇÓÐЧµÄ¡£

¡ö¡¡¡¡¡¡CFM_UNDERLINE¡ª¡ªdwEffects×Ö¶ÎÖеÄCFE_UNDERLINEÖµÊÇÓÐЧµÄ¡£

¡ñ¡¡¡¡¡¡dwEffects¡ª¡ª×Ö·ûЧ¹û£¬¿ÉÒÔÊÇÒÔÏÂÖµµÄ×éºÏ£º

¡ö¡¡¡¡¡¡CFE_AUTOCOLOR¡ª¡ªÊ¹ÓÃϵͳÕýÎÄÑÕÉ«¡£

¡ö¡¡¡¡¡¡CFE_BOLD£¬CFE_ITALIC£¬CFE_STRIKEOUTºÍCFE_UNDERLINE¡ª¡ª´ÖÌå×Ö·û¡¢Ð±Ìå×Ö·û¡¢´øɾ³ýÏߺʹøÏ»®Ïß¡£

¡ö¡¡¡¡¡¡CFE_PROTECTED¡ª¡ª×Ö·ûÊÇÊܱ£»¤µÄ£¬Æóͼ¸Ä±ä×Ö·ûµÄ»°¿Ø¼þ»áÏò¸¸´°¿Ú·¢ËÍÒ»¸öEN_PROTECTED֪ͨÏûÏ¢¡£

¡ñ¡¡¡¡¡¡yHeight¡ª¡ª×Ö·û¸ß¶È£¬µ¥Î»ÊÇ1/1¡¡440¡¡Ó¢´ç£¨»ò1/20°õ£©£¬Èç¹ûÕâÀïÊÇ180£¬»»Ëãµ½¡°×ÖÌåÑ¡Ôñ¡±Í¨ÓöԻ°¿òÖеijߴç¾ÍÊÇ9°õ£¨180¡Á1/20=9£©¡£

¡ñ¡¡¡¡¡¡yOffset¡ª¡ª´Ó»ùÏßËãÆðµÄ×Ö·ûÆ«ÒÆ£¬µ¥Î»Í¬ÉÏ£¬Èç¹û¸Ã³ÉÔ±ÊÇÕýÖµ£¬×Ö·ûÏÔʾΪÉϱꣻÈç¹ûÊǸºÖµ£¬×Ö·ûÏÔʾΪϱꡣ

¡ñ¡¡¡¡¡¡crTextColor¡ª¡ªÕýÎÄÑÕÉ«£¬Èç¹ûÔÚdwEffects×Ö¶ÎÖÐÖ¸¶¨ÁËCFE_AUTOCOLOR±êÖ¾£¬ÄÇôÕâ¸öÖµ»á±»ºöÂÔ¡£

¡ñ¡¡¡¡¡¡bCharSetºÍbPitchAndFamily¡ª¡ª×Ö·û¼¯¡£

¡ñ¡¡¡¡¡¡szFaceName¡ª¡ªÓÃ×Ö·û´®±íʾµÄ×ÖÌåÃû×Ö¡£

ͨ¹ýÌî³äÕâ¸ö½á¹¹²¢½«Ëüͨ¹ýEM_SETCHARFORMATÏûÏ¢´«Ë͸ø¿Ø¼þ£¬¿ÉÒԸıäÎÄ×ÖµÄЧ¹û£¨´ÖÌ塢бÌå¡¢´øɾ³ýÏß¡¢´øÏ»®Ïߵȣ©£¬ÕýÎÄÑÕÉ«£¨crTextColor£©£¬×ÖÌåÍâ¹Û£¨szFaceName£©ºÍ×ÖÌå´óС£¨yHeight£©£¬ÒÔ¼°Ê¹ÓõÄ×Ö·û¼¯µÈ¡£Ê¹ÓÃCHARFORMAT2½á¹¹¿ÉÒÔÉèÖøü¶àµÄÎı¾·ç¸ñ£¬Èç×Ö¼ä¾àÓëÕýÎı³¾°É«µÈ¡£Èç¹û²»ÐèÒªÕâЩ¶îÍâµÄ¹¦ÄÜ£¬ÄÇôֻҪʹÓÃCHARFORMAT½á¹¹¾Í¿ÉÒÔÁË¡£

Àý×Ó³ÌÐòRichedit¡£asmÖÐÖ»ÑÝʾÁËʹÓÃPlain¡¡TextģʽΪËùÓÐÎı¾ÉèÖÃ×ÖÌåµÄ·½·¨£º

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡nst

szFont¡¡¡¡db¡¡¡¡¡¡¡¡¡¡¡¡'ËÎÌå'£»0

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡de

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡SendMessage£»hWinEdit£»EM_SETTEXTMODE£»TM_PLAINTEXT£»0

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡RtlZeroMemory£»addr¡¡@stCf£»sizeof¡¡@stCf

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡@stCf¡£cbSize£»sizeof¡¡@stCf

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡@stCf¡£yHeight£»9¡¡*¡¡20

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡@stCf¡£dwMask£»CFM_FACE¡¡or¡¡CFM_SIZE¡¡or¡¡CFM_BOLD

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡lstrcpy£»addr¡¡@stCf¡£szFaceName£»addr¡¡szFont

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡SendMessage£»hWinEdit£»EM_SETCHARFORMAT£»0£»addr¡¡@stCf

³ÌÐòÊ×ÏȽ«¿Ø¼þµÄģʽÉèÖÃΪPlain¡¡Textģʽ£¬È»ºó¶¨ÒåÁËÒ»¸öÃûΪ@stCfµÄCHARFORMAT½á¹¹£¬½«½á¹¹³¤¶ÈÉèÖÃΪCHARFORMAT½á¹¹µÄ³¤¶È£¬È»ºóÔÚdwMask¡¡×Ö¶ÎÖÐʹÓÃCFM_FACE£¬¡¡CFM_SIZEºÍCFM_BOLD±êÖ¾£¬±íʾֻʹÓÃ×ÖÌå¡¢×ÖÌå´óСºÍ×ÖÌå´Öϸ²ÎÊý£¬×îºó·¢ËÍEM_SETCHARFORMATÏûÏ¢½«¿Ø¼þÖеÄÈ«²¿ÎÄ×ÖÉèÖÃΪ´óСΪ9°õ£¨Ð¡ÎåºÅ£©µÄ¡°ËÎÌ塱¡£

4¡£¡¡×°ÈëºÍ±£´æÎı¾

ÏÔÈ»£¬Ê¹ÓÃGetWindowTextºÍSetWindowTextº¯ÊýÀ´±£´æºÍ×°ÈëÎı¾ÊÇ¿ÉÐеģ¬µ«ÊÇRichEdit¿Ø¼þÖ§³ÖºÜ´óµÄÎļþ£¬µ±Îļþ×ã¹»´óµÄʱºò£¬Ê¹ÓÃÕâÖÖ·½·¨¾ÍºÜÂé·³£¬ÒòΪ±ØÐëÊ×ÏÈÒª·ÖÅäÒ»¿é×ã¹»´óµÄÄÚ´æÓÃ×ö»º³åÇø£¬ÎªÁ˽â¾öÕâ¸öÎÊÌ⣬Richedit¿Ø¼þÌṩÁËÒ»ÖÖз½·¨£¬ÄǾÍÊÇÎı¾Á÷£¨Text¡¡Streaming£©¡£

¿¼ÂÇÕâÑùÒ»ÖÖÇé¿ö£ºÎªÁË×°ÈëÎı¾£¬¿ÉÒÔÉêÇëÒ»¿é´óСºÏÊʵĻº³åÇø£¨µ±È»²»»á´óµ½ÄÜÈÝÄÉÈ«²¿Îı¾£©£¬Ã¿´Î´ÓÎļþÖжÁÈ뻺³åÇø´óСµÄÎı¾²¢Ìí¼Óµ½¿Ø¼þÖУ¬Èç´ËÑ­»·Ö±µ½¶ÁÈëÈ«²¿Îı¾£»±£´æÎı¾µÄʱºò£¬Í¬Ñù¿ÉÒÔÿ´Î´Ó¿Ø¼þÖÐÈ¡³ö»º³åÇø´óСµÄÎı¾£¬È»ºóдÈëÎļþ£¬Èç´ËÑ­»·Ö±µ½´¦ÀíÍê¿Ø¼þÖеÄÈ«²¿Îı¾¡£

Îı¾Á÷µÄ²Ù×÷·½·¨Óë´ËÀàËÆ£¬Ö»²»¹ý»º³åÇøºÍÑ­»·¶¼·â×°ÔڿؼþµÄÄÚ²¿£¬¶øÎÒÃÇͨ¹ýÌṩ»Øµ÷º¯ÊýµÄ°ì·¨Ìṩ¶ÁдÎļþµÄ¹¦ÄÜÄ£¿é£¬Richedit¿Ø¼þÑ­»·µ÷ÓÃÕâ¸öÄ£¿éÖ±µ½´¦ÀíÍêÈ«²¿µÄÄÚÈÝ¡£Ã¿´Îµ÷ÓõÄʱºò£¬¿Ø¼þͨ¹ý²ÎÊý¸æË߻ص÷º¯ÊýÒª¶ÁдµÄ×Ö½ÚÊýºÍ»º³åÇøµÄµØÖ·¡£Îı¾µÄÁ÷ÈëºÍÁ÷³öʹÓÃEM_STREAMINºÍEM_STREAMOUTÏûÏ¢£¬ÕâÁ½¸öÏûÏ¢µÄʹÓøñʽÊÇÒ»ÑùµÄ£º

¡¡¡¡¡¡¡¡invoke¡¡¡¡SendMessage£»hWinEdit£»EM_STREAMIN£»uFormat£»lpStream

¡¡¡¡¡¡¡¡invoke¡¡¡¡SendMessage£»hWinEdit£»EM_STREAMOUT£»uFormat£»lpStream

wParam²ÎÊýÖеÄuFormatÖ¸¶¨ÐèÒªÁ÷Èë/Á÷³öµÄÄÚÈÝ£¬Ëü¿ÉÒÔÊÇÒÔϵÄÈ¡Öµ£º

¡ñ¡¡¡¡¡¡SF_RTF¡ª¡ªÎı¾¸ñʽÊÇRTF¸ñʽ¡£

¡ñ¡¡¡¡¡¡SF_TEXT¡ª¡ªÎı¾ÊÇPlain¡¡Text¸ñʽ£¬Ò²¾ÍÊǼòµ¥µÄÎı¾¸ñʽ¡£

¡ñ¡¡¡¡¡¡SFF_SELECTION¡ª¡ªÁ÷²Ù×÷µÄ·¶Î§Êǵ±Ç°Ñ¡ÔñÇøÓò¡£Èç¹û½«Îı¾Á÷È룬µ±Ç°Ñ¡ÔñÇøÓò¾Í»á±»Ìæ»»£»Èç¹ûÊÇÁ÷³ö£¬ÔòÖ»ÓÐÄÇЩµ±Ç°Ñ¡¶¨µÄÎı¾²ÅÁ÷³ö¡£Èç¹ûûÓÐÖ¸¶¨Õâ¸ö±êÖ¾£¬²Ù×÷·¶Î§ÊǿؼþÖеÄËùÓÐÎı¾¡£

¡ñ¡¡¡¡¡¡SF_UNICODE¡ª¡ªÖ¸¶¨µÄÊÇ¡¡Unicode¡¡Îı¾£¨2¡£0¼°ÒÔÉÏ°æ±¾Ìṩ£©¡£

lParam²ÎÊýÖеÄlpStreamÖ¸ÏòÒ»¸öEDITSTREAM¡¡½á¹¹£¬¸Ã½á¹¹¶¨ÒåÈçÏ£º

¡¡EDITSTREAM¡¡STRUCT¡¡

¡¡¡¡¡¡¡¡dwCookie¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡£»Óû§×Ô¶¨ÒåÖµ

¡¡¡¡¡¡¡¡dwError¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡£»ÓÃÀ´·µ»ØÁ÷²Ù×÷¹ý³ÌÖеĴíÎóÐÅÏ¢

¡¡¡¡¡¡¡¡pfnCallback¡¡DWORD¡¡¡¡¡¡£¿¡¡¡¡¡¡£»»Øµ÷º¯ÊýµØÖ·

EDITSTREAM¡¡ENDS

½á¹¹Öи÷×ֶεÄ˵Ã÷ÈçÏ£º

¡ñ¡¡¡¡¡¡dwCookie¡ª¡ªÓ¦ÓóÌÐò×Ô¶¨ÒåµÄÊýÖµ£¬Õâ¸öÊýÖµ½«»á´«µÝ¸ø»Øµ÷º¯Êý¡£

¡ñ¡¡¡¡¡¡dwError¡ª¡ªÖ¸Ê¾Á÷²Ù×÷µÄ½á¹û£¬0˵Ã÷ûÓдíÎó¡£

¡ñ¡¡¡¡¡¡pfnCallback¡ª¡ªÖ¸Ïò»Øµ÷º¯Êý£¬¸Ãº¯ÊýÓÉÓû§¶¨Ò壬²¢ÓÉRichEdit¿Ø¼þµ÷ÓÃÀ´´«ÊäÎı¾¡£RichEdit¿Ø¼þ½«Îı¾·Ö³É¶à¸ö²¿·Ö£¬Ã¿´Îµ÷Óøú¯Êý´¦ÀíÒ»¸ö²¿·Ö£¬Ö±µ½È«²¿Îı¾±»´¦ÀíΪֹ¡£

»Øµ÷º¯ÊýµÄ¶¨ÒåÈçÏ£º

EditStreamCallback¡¡¡¡proc¡¡¡¡¡¡¡¡dwCookie£»lpBuffer£»NumBytes£»¡¡pBytesTransferred

¿Ø¼þ´«µÝ¸ø»Øµ÷º¯ÊýµÄ²ÎÊý˵Ã÷ÈçÏ£º

¡ñ¡¡¡¡¡¡dwCookie¡ª¡ª¾ÍÊÇÏûÏ¢ÖÐÖ¸¶¨µÄEDITSTREAM½á¹¹Öж¨ÒåµÄdwCookieÖµ¡£

¡ñ¡¡¡¡¡¡lpBuffer¡ª¡ªÖ¸ÏòRichedit¿Ø¼þÌṩµÄ»º³åÇø¡£¶ÔÓÚÁ÷Èë²Ù×÷£¬ÕâÀïÓÃÀ´½ÓÊÕÁ÷ÈëµÄÎı¾£»¶ÔÓÚÁ÷³ö²Ù×÷£¬ÕâÀï´æ·ÅÒªÁ÷³öµÄÎı¾¡£

¡ñ¡¡¡¡¡¡NumBytes¡ª¡ª±¾´Îµ÷ÓÃÖпÉÒÔ²Ù×÷µÄ×Ö½ÚÊý¡£¶ÔÓÚÁ÷Èë²Ù×÷£¬±íʾ¿ÉÒÔдÈ뻺³åÇøµÄ×î´ó×Ö½ÚÊý£»¶ÔÓÚÁ÷³ö²Ù×÷£¬±íʾÐèÒªÁ÷³öµÄÎı¾µÄ³¤¶È¡£

¡ñ¡¡¡¡¡¡pBytesTransferred¡ª¡ªÖ¸ÏòÒ»¸öË«×Ö£¬ÓÉÓÚʵ¼Ê²Ù×÷µÄ×Ö½ÚÊý²»Ò»¶¨µÈÓÚNumBytes²ÎÊýÖ¸¶¨µÄÊýÖµ£¨±ÈÈçÁ÷Èëʱ¶Áµ½ÁËÎļþβ²¿£©£¬²Ù×÷ºó±ØÐëÔÚÕâÀï·µ»Øʵ¼Ê²Ù×÷µÄ×Ö½ÚÊý¡£

»Øµ÷º¯Êý·µ»Ø0˵Ã÷²Ù×÷³É¹¦£¬ÕâÑùÈç¹û»¹ÓÐÊý¾ÝÐèÒª¶Áд£¬RichEdit¿Ø¼þ¾Í»á¼ÌÐøµ÷ÓÃËü¡£Èç¹û²Ù×÷Öз¢ÉúÁË´íÎ󣬶øÇÒ³ÌÐòÐèҪֹͣ²Ù×÷µÄ»°£¬¿ÉÒÔ·µ»ØÒ»¸ö·Ç0Öµ£¬ÕâʱRichedit¿Ø¼þ¾Í»á¶ªÆúlpBufferÖ¸ÏòµÄÊý¾Ý²¢Í£Ö¹¶Ô»Øµ÷º¯ÊýµÄ¼ÌÐøµ÷Óᣵ±ÏûÏ¢·µ»ØµÄʱºò£¬Óɻص÷º¯Êý·µ»ØµÄ´íÎó/³É¹¦Öµ»áÔÚEDITSTREAM½á¹¹µÄdwError×Ö¶ÎÖзµ»Ø£¬ËùÒÔ¿ÉÒÔÔÚSendMessage·µ»ØºóÒԴ˼ì²éÁ÷²Ù×÷ÊÇ·ñ³É¹¦¡£

ÔÚÀý×ÓÎļþÖУ¬½øÐÐÁ÷²Ù×÷ÈçÏ£º

£»¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·

£»¡¡»Øµ÷º¯Êý

£»¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·

_ProcStream¡¡¡¡¡¡¡¡¡¡proc¡¡uses¡¡ebx¡¡edi¡¡esi¡¡_dwCookie£»_lpBuffer£»_dwBytes£»_lpBytes

¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£if¡¡¡¡¡¡¡¡¡¡_dwCookie

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡¡¡ReadFile£»hFile£»_lpBuffer£»_dwBytes£»_lpBytes£»0

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£else

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡¡¡WriteFile£»hFile£»_lpBuffer£»_dwBytes£»_lpBytes£»0

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£endif

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡xor¡¡¡¡¡¡¡¡¡¡eax£»eax

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ret

¡¡¡¡¡¡¡¡

_ProcStream¡¡¡¡¡¡¡¡¡¡endp

£»¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·

£»¡¡Á÷³ö²Ù×÷

£»¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡@stES¡£dwCookie£»FALSE¡¡¡¡¡¡¡¡£»¡¡¡¡@stESÊÇÒ»¸öEDITSTREAM½á¹¹

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡@stES¡£pfnCallback£»offset¡¡_ProcStream

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡SendMessage£»hWinEdit£»EM_STREAMOUT£»SF_TEXT£»addr¡¡@stES

£»¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·

£»¡¡Á÷Èë²Ù×÷

£»¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·¡·

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡@stES¡£dwCookie£»TRUE

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡@stES¡£pfnCallback£»offset¡¡_ProcStream

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡SendMessage£»hWinEdit£»EM_STREAMIN£»SF_TEXT£»addr¡¡@stES

³ÌÐòÖÐÁ÷ÈëºÍÁ÷³ö²Ù×÷µÄ»Øµ÷º¯ÊýʹÓ
·µ»ØĿ¼ ÉÏÒ»Ò³ ÏÂÒ»Ò³ »Øµ½¶¥²¿ ÔÞ£¨0£© ²È£¨0£©
δÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡
ÎÂÜ°Ìáʾ£º ο´Ð¡ËµµÄͬʱ·¢±íÆÀÂÛ£¬Ëµ³ö×Ô¼ºµÄ¿´·¨ºÍÆäËüС»ï°éÃÇ·ÖÏíÒ²²»´íŶ£¡·¢±íÊéÆÀ»¹¿ÉÒÔ»ñµÃ»ý·ÖºÍ¾­Ñé½±Àø£¬ÈÏÕæдԭ´´ÊéÆÀ ±»²ÉÄÉΪ¾«ÆÀ¿ÉÒÔ»ñµÃ´óÁ¿½ð±Ò¡¢»ý·ÖºÍ¾­Ñé½±ÀøŶ£¡