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

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

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




9¡£3¡£3¡¡¡¡¹¤¾ßÀ¸µÄ֪ͨÏûÏ¢

´ó²¿·ÖͨÓÿؼþÏò¸¸´°¿Ú·¢Ë͵Ä֪ͨÏûÏ¢ÊÇWM_NOTIFY£¬ÎªÁ˱ãÓںͲ˵¥ÏûϢʹÓÃͬһ¶ÎÃüÁî´¦ÀíµÄÂß¼­´úÂ룬µ±°´¶¯¹¤¾ßÀ¸°´Å¥µÄʱºò£¬¹¤¾ßÀ¸¿Ø¼þÏò¸¸´°¿Ú·¢Ë͵ÄÊÇWM_MANDÏûÏ¢£¬µ«ÆäËûÇé¿öÏ·¢Ë͵Ä֪ͨÏûÏ¢ÈÔÈ»ÊÇWM_NOTIFYÏûÏ¢¡£

¹¤¾ßÀ¸·¢Ë͵ÄWM_NOTIFYÏûÏ¢Ö÷ÒªÓÃÓÚÏÔʾ¹¤¾ßÌáʾºÍ¶¨Öƹ¤¾ßÀ¸¡£

1¡£¡¡¹¤¾ßÌáʾ

µ±¹¤¾ßÀ¸µÄ·ç¸ñ°üº¬TBSTYLE_TOOLTIPSµÄʱºò£¬CreateToolbarExº¯Êý×Ô¶¯´´½¨Ò»¸ö¹¤¾ßÌáʾ¿Ø¼þ£¨Tool¡¡Tip£©£¬²¢Îª¹¤¾ßÀ¸ÉϵÄÿ¸ö°´Å¥×¢²áÌáʾÎı¾£¬µ±Êó±êÖ¸ÕëÒƶ¯µ½°´Å¥Éϲ¢Í£ÁôƬ¿ÌµÄʱºò£¬¹¤¾ßÌáʾÐÅÏ¢»á×Ô¶¯ÏÔʾ³öÀ´¡£

¹¤¾ßÌáʾÐÅÏ¢Êǹ¤¾ßÌáʾ¿Ø¼þͨ¹ý°üº¬TTN_NEEDTEXT֪ͨÂëµÄWM_NOTIFYÏûÏ¢Ïò¸¸´°¿ÚË÷È¡µÄ£¬ËùÒÔÕâ¸öWM_NOTIFYÏûÏ¢ÑϸñµØ˵Ӧ¸ÃÊôÓÚ¹¤¾ßÌáʾ¿Ø¼þµÄ֪ͨÏûÏ¢¶ø²»Êǹ¤¾ßÀ¸µÄ֪ͨÏûÏ¢£¬µ«ÕâÀïµÄ¹¤¾ßÌáʾ¿Ø¼þÊÇCreateToolbarExº¯Êý×Ô¶¯´´½¨µÄ£¬ËùÒÔ»¹ÊÇÒ»Æð½éÉÜ¡£

ÔÚ°üº¬TTN_NEEDTEXT֪ͨÂëµÄWM_NOTIFYÏûÏ¢ÖУ¬lParamÖ¸ÏòÒ»¸öTOOLTIPTEXT½á¹¹¡ª¡ªÂý×Å£¡Ç°Ãæ²»ÊÇ˵WM_NOTIFYÏûÏ¢µÄlParam²ÎÊýÖ¸ÏòÒ»¸öNMHDRÂð£¿ÔõôÓÖÊÇTOOLTIPTEXT½á¹¹ÄØ£¿ÓÉÓÚ²»Í¬¿Ø¼þµÄ֪ͨÏûÏ¢¶¼Ê¹ÓÃWM_NOTIFYÏûÏ¢£¬ÓÐЩ֪ͨÏûÏ¢¿ÉÄÜÐèÒª¸½´øÆäËûÊý¾Ý£¬Õâʱ½öʹÓÃÒ»¸öNMHDR½á¹¹À´±í´ïÊDz»¹»µÄ£¬WindowsµÄ´¦Àí°ì·¨ÊÇΪÐèÒª¸½´øÆäËûÊý¾ÝµÄWM_NOTIFYÏûÏ¢¶¨Ò岻ͬµÄÊý¾Ý½á¹¹£¬µ«ÕâЩ½á¹¹Í·²¿¶¼ÊÇÒ»¸öNMHDR½á¹¹£¬NMHDR½á¹¹ÒÔºó²ÅÊÇÆäËû×ֶΣ¬ÕâÑùÔÚµÃ֪֪ͨÂë֮ǰ£¬°ÑlParam²ÎÊýÖ¸Õëµ±×öÒ»¸öNMHDR½á¹¹À´´¦Àí×ÜÊÇÕýÈ·µÄ¡£¶øÇÒÖ»ÓÐÏÈ°ÑlParam²ÎÊýÖ¸Õëµ±×öNMHDR½á¹¹´¦Àí²¢´ÓÖлñȡ֪ͨÂëÒԺ󣬲ÅÕæÕýÖªµÀlParamÖ¸ÏòµÄ¾¿¾¹ÊÇʲô½á¹¹¡£

ºÃÁË£¬ÎÊÌâ½â¾öÁË£¬ÑÔ¹éÕý´«¡£TTN_NEEDTEXT֪ͨÂëµÄlParamÖ¸ÏòÒ»¸öTOOLTIPTEXT½á¹¹£¬Õâ¸ö½á¹¹µÄ¶¨ÒåÊÇ£º¡¡

TOOLTIPTEXT¡¡STRUCT

¡¡¡¡hdr¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡NMHDR¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»Í·²¿Î»ÖÃÊÇÒ»¸öNMHDR½á¹¹

¡¡¡¡lpszText¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡¡¡£»¹¤¾ßÌáʾ×Ö·û´®Ö¸Õë

¡¡¡¡szText¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡BYTE¡¡80¡¡dup¡¡£¨£¿£©¡¡£»¹¤¾ßÌáʾ×Ö·û´®»º³åÇø

¡¡¡¡hInst¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»°üº¬×Ö·û´®×ÊÔ´µÄÄ£¿é¾ä±ú

¡¡¡¡uFlags¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»±êÖ¾

TOOLTIPTEXT¡¡ENDS

µ±ÐèÒªÏÔʾ¹¤¾ßÌáʾÐÅÏ¢µÄʱºò£¬¹¤¾ßÌáʾ¿Ø¼þÏò¸¸´°¿Ú·¢ËÍTTN_NEEDTEXT֪ͨÂ룬¸¸´°¿Ú½«ÐèÒªÏÔʾµÄÌáʾ×Ö·û´®·ÅÔÚTOOLTIPTEXT½á¹¹Öв¢·µ»ØÒԺ󣬹¤¾ßÌáʾ¿Ø¼þ¾Í»á°ÑËüÏÔʾ³öÀ´¡£ÉèÖÃTOOLTIPTEXT½á¹¹µÄ°ì·¨ÓÐ3ÖÖ£¬¶ÁÕß¿ÉÒÔÈÎÑ¡ÆäÒ»£º

£¨1£©×Ö·û´®°üº¬ÔÚ×ÊÔ´ÖУ¬Õâʱ¿ÉÒÔ½«hInst×Ö¶ÎÉèÖÃΪ°üº¬×ÊÔ´µÄÄ£¿é¾ä±ú£¬²¢°ÑlpszText×Ö¶ÎÉèÖÃΪ×Ö·û´®ID£¬ÆäËû×ֶα£³ÖΪNULL£¬¹¤¾ßÌáʾ»á×Ô¼ºÊ¹ÓÃLoadStringº¯Êý×°Èë×Ö·û´®¡£

£¨2£©½«×Ö·û´®·ÅÔÚÄÚ´æÖУ¬½«ÄÚ´æÖ¸Õë·ÅÈëlpszText×Ö¶ÎÖУ¬ÆäËû×ֶα£³ÖNULL¡£

£¨3£©½«×Ö·û´®¿½ÈëszText×Ö¶ÎÖУ¬ÆäËû×ֶα£³ÖNULL¡£

Àý×Ó³ÌÐòʹÓÃÁ˵ÚÒ»ÖÖ°ì·¨¡£ÓÉÓÚNMHDR½á¹¹µÄidFrom×Ö¶ÎÒѾ­·µ»ØÁË°´Å¥µÄÃüÁîID£¬ËùÒÔÔÚ×ÊÔ´½Å±¾ÎļþÖн«×Ö·û´®µÄIDºÍÃüÁîIDÒ»Ò»¶ÔÓ¦¶¨Ò壬ȻºóʹÓõÚÒ»ÖÖ·½·¨ÊÇ×î·½±ãµÄ£¬´úÂëÈçÏ£º

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£elseif¡¡eax¡¡¡¡¡¡WM_NOTIFY

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡ebx£»lParam

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£if¡¡¡¡¡¡¡¡¡¡£§ebx¡¡£«¡¡NMHDRde£§¡¡¡¡TTN_NEEDTEXT

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡assume¡¡¡¡ebx£ºptr¡¡TOOLTIPTEXT

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡eax£»£§ebx£§¡£hdr¡£idFrom

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡£§ebx£§¡£lpszText£»eax

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡push¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡hInstance

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡pop¡¡¡¡¡¡¡¡¡¡£§ebx£§¡£hinst

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡assume¡¡¡¡ebx£ºnothing

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¡£¡£

¶ÁÕß¿ÉÒÔ×Ô¼º³¢ÊÔÒ»ÏÂÆäËûµÄ·½·¨¡£



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


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


9¡£3¡¡Ê¹Óù¤¾ßÀ¸£¨6£©

¡¡¡¡¡¡¡¡
2¡£¡¡¶¨Öƹ¤¾ßÀ¸

¶¨Öƹ¦ÄÜÊǹ¤¾ßÀ¸ÖÐ×îÁîÈËÐ˷ܵÄÌØÕ÷£ºµ±¹¤¾ßÀ¸°üº¬CCS_ADJUSTABLE·ç¸ñµÄʱºò£¬Óû§¿ÉÒÔͨ¹ý°´ÏÂShift¼ü²¢Í϶¯¹¤¾ßÀ¸Éϵİ´Å¥À´Òƶ¯°´Å¥Î»Öã»Èç¹û½«°´Å¥Íϳö¹¤¾ßÀ¸µÄ±ß½ç£¬°´Å¥»á±»É¾³ý£»¸üÖØÒªµÄÊÇ£¬Èç¹ûÏò¹¤¾ßÀ¸·¢ËÍTB_CUSTOMIZEÏûÏ¢»òÕßÔÚ¹¤¾ßÀ¸µÄ¿Õ°×´¦Ë«»÷Êó±ê£¬»áÏÔʾ³öÒ»¸öÈçͼ9¡£7ËùʾµÄ¡°×Ô¶¨Ò幤¾ßÀ¸¡±¶Ô»°¿ò£¬¶Ô»°¿òÓұߵÄÁбí¿òÖÐÁгöÁ˵±Ç°ÏÔʾÔÚ¹¤¾ßÀ¸Éϵİ´Å¥£¬×ó±ßÁбí¿òÁгöÁË¿ÉÒÔÌí¼Óµ½¹¤¾ßÀ¸Éϵİ´Å¥£¬Óû§¿ÉÒÔ½«Ò»¸ö°´Å¥ËæÒâÔÚʹÓúͲ»Ê¹ÓÃÖ®¼äÇл»£¬²¢ÇÒ¿ÉÒÔͨ¹ýÍ϶¯°´Å¥µÄÉÏÏÂλÖÃÀ´¾ö¶¨°´Å¥ÔÚ¹¤¾ßÀ¸ÉϵÄλÖá£

¹¤¾ßÀ¸Í¨¹ýһϵÁеÄ֪ͨÐÅÏ¢À´ºÍ¸¸´°¿Ú½»»¥£¬¹²Í¬Î¬»¤¡°×Ô¶¨Ò幤¾ßÀ¸¡±¶Ô»°¿ò£¬ÔÚÕâ¸ö¶Ô»°¿ò½¨Á¢ºÍ¹Ø±ÕµÄʱºò£¬¹¤¾ßÀ¸Í¨¹ýTBN_BEGINADJUSTºÍTBN_ENDADJUST֪ͨÂëÀ´Í¨Öª¸¸´°¿Ú£»Ã¿´Î°´Å¥±»µ÷ÕûµÄʱºò£¬·¢Ë͵ÄÊÇTBN_TOOLBARCHANGE֪ͨÂ룻ÔÚ°´Ï¶Ի°¿òÖеġ°°ïÖú¡±°´Å¥ºÍ¡°ÖØÖá±°´Å¥µÄʱºò£¬·¢Ë͵ÄÊÇTBN_CUSTHELPºÍTBN_RESET֪ͨÂ룬¶ÔÓÚÕâЩ֪ͨÂ룬¸¸´°¿Ú¿ÉÒÔ²»±ØÏìÓ¦£¬Õâ²¢²»»áÓ°Ïì¶Ô»°¿òµÄʹÓá£

Óë¶Ô»°¿òÊÇ·ñÄܹ»Õý³£ÔËÐÐÓйصÄ֪ͨÂëÊÇTBN_QUERYINSERT£¬TBN_QUERYDELETEºÍTBN_GETBUTTONINFO£¬¸¸´°¿Ú±ØÐëÓ¦´ðÕâЩ֪ͨÂë¡£


ͼ9¡£7¡¡¡¡×Ô¶¨Ò幤¾ßÀ¸¶Ô»°¿ò

µ±Óû§ÔÚÖ¸¶¨Î»ÖòåÈëÒ»¸ö°´Å¥µÄʱºò£¬¹¤¾ßÀ¸·¢ËÍTBN_QUERYINSERT֪ͨÂëѯÎʸ¸´°¿ÚÊÇ·ñÔÊÐí´Ë²Ù×÷£¬ÕâʱlParamÖ¸ÏòÒ»¸öTBNOTIFY½á¹¹£¬Õâ¸ö½á¹¹¶¨ÒåÈçÏ£º

TBNOTIFY¡¡STRUCT

¡¡¡¡hdr¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡NMHDR¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»ÏÔÈ»£¬ÕâÀï¿Ï¶¨ÊÇNMHDR½á¹¹

¡¡¡¡iItem¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡¡¡£»°´Å¥µÄλÖÃË÷Òý

¡¡¡¡tbButton¡¡¡¡¡¡¡¡¡¡¡¡¡¡TBBUTTON¡¡¡¡£»°üº¬°´Å¥ÐÅÏ¢µÄTBBUTTON½á¹¹

¡¡¡¡cchText¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡£»pszTextÖÐ×Ö·û´®µÄ³¤¶È

¡¡¡¡pszText¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DWORD¡¡¡¡¡¡¡¡¡¡¡¡£¿¡¡£»°´Å¥µÄ˵Ã÷×Ö·û´®

TBNOTIFY¡¡ENDS

¡¡

Èç¹û³ÌÐòÔÊÐíÔÚ´Ë°´Å¥Ç°Ãæ²åÈëÒ»¸öа´Å¥£¬ÄÇô·µ»ØTRUE£¬·ñÔò·µ»ØFALSE¡£ÁíÍâµ±×Ô¶¨Òå¶Ô»°¿ò¸ÕÏÔʾµÄʱºò£¬¸¸´°¿ÚÒ²»áÊÕµ½Õâ¸ö֪ͨÂ룬Õâʱ±ØÐë·µ»ØTRUE£¬·ñÔò¶Ô»°¿òÔÚÆÁÄ»ÉÏÒ»ÉÁ¾ÍÏûʧÁË¡£

µ±Óû§ÒªÉ¾³ýÒ»¸ö°´Å¥µÄʱºò£¬¹¤¾ßÀ¸·¢ËÍTBN_QUERYDELETE֪ͨÂ룬ѯÎʸ¸´°¿ÚÊÇ·ñÔÊÐí´Ë²Ù×÷£¬ÕâʱlParamÒ²Ö¸ÏòÒ»¸öTBNOTIFY½á¹¹£¬ÓÃÀ´ËµÃ÷½«ÒªÉ¾³ýµÄ°´Å¥£¬Èç¹û³ÌÐòÔÊÐí´Ë²Ù×÷Ôò·µ»ØTRUE£¬·ñÔò·µ»ØFALSE¡£

¡¡¡¡¡¡¡¡¡£elseif¡¡£¨£§ebx¡¡£«¡¡NMHDRde£§¡¡¡¡TBN_QUERYINSERT£©¡¡£ü£ü¡¡¡¡¡¡¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¨£§ebx¡¡£«¡¡NMHDRde£§¡¡¡¡TBN_QUERYDELETE£©¡¡¡¡£»ÏÖÔÚebx¡¡=¡¡lParam

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡eax£»TRUE

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

ÔÚÀý×Ó³ÌÐòÖÐʹÓÃÉÏÃæµÄ´úÂëÀ´´¦ÀíÕâÁ½¸ö֪ͨÂ룬Ҳ¾ÍÊÇ˵¶ÔÓÚÈ«²¿µÄÇé¿ö¾ù·µ»ØTRUE£¬±íʾÔÊÐíÓû§ËæÒâ½øÐÐÒƶ¯°´Å¥ºÍɾ³ý°´Å¥µÄ²Ù×÷¡£

TBN_GETBUTTONINFO֪ͨÂëµÄ´¦Àí¾Í±È½Ï¸´ÔÓÁË£¬µ±¹¤¾ßÀ¸ÐèҪȫ²¿°´Å¥µÄÐÅÏ¢µÄʱºò£¬»á¶à´Î·¢ËÍTBN_GETBUTTONINFO֪ͨÂ룬ÔÚÀý×Ó³ÌÐòÖÐÊÇÕâÑù´¦ÀíµÄ£º

¡£elseif¡¡£§ebx¡¡£«¡¡NMHDRde£§¡¡¡¡TBN_GETBUTTONINFO¡¡£»ÏÖÔÚebx¡¡=¡¡lParam

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡assume¡¡¡¡ebx£ºptr¡¡TBNOTIFY¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»lParamÒ²ÊÇÖ¸ÏòÒ»¸öTBNOTIFY½á¹¹

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡eax£»£§ebx£§¡£iItem

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£if¡¡¡¡¡¡¡¡¡¡eax¡¡¡¶¡¡NUM_BUTTONS

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡ecx£»sizeof¡¡TBBUTTON

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mul¡¡¡¡¡¡¡¡¡¡ecx

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡add¡¡¡¡¡¡¡¡¡¡eax£»offset¡¡stToolbar

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡RtlMoveMemory£»addr¡¡£§ebx£§¡£tbButton£»eax£»sizeof¡¡TBBUTTON

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡LoadString£»hInstance£»£§ebx£§¡£tbButton¡£idmand£»

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡addr¡¡@szBuffer£»sizeof¡¡@szBuffer

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lea¡¡¡¡¡¡¡¡¡¡eax£»@szBuffer

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡£§ebx£§¡£pszText£»eax

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡lstrlen£»addr¡¡@szBuffer

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡£§ebx£§hText£»eax

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡assume¡¡¡¡ebx£ºnothing

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡eax£»TRUE

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

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

Ê×ÏÈÀ´·ÖÎöΪʲôҪÕâÑù´¦ÀíTBN_GETBUTTONINFO֪ͨÂë¡£

¹¤¾ßÀ¸¿Ø¼þÿ´Î×ÜÊÇ·¢ËÍÒ»×éTBN_GETBUTTONINFO֪ͨÂ룬²¢ÇÒÿ´ÎTBNOTIFY½á¹¹ÖеÄiItem×ֶεÝÔö£¬¸¸´°¿ÚÐèҪÿ´ÎÔڽṹÖзµ»ØÒ»¸ö°´Å¥µÄÐÅÏ¢£¬Èç¹û»¹ÓÐÊ£ÓàµÄ°´Å¥ÐÅϢûÓиæËß¹¤¾ßÀ¸£¨±ÈÈçÔÚÓð´Å¥ºÍ¿ÉÑ¡°´Å¥¼ÓÆðÀ´×ܹ²ÓÐ15¸ö£¬ÏÖÔÚ·µ»ØÁË10¸ö£¬ÄÇô»¹Ê£5¸ö°´Å¥ÐÅϢûÓиæËß¹¤¾ßÀ¸£©£¬ÔòÔÚÏûÏ¢µÄ·µ»ØÖµÖзµ»ØTRUE£¬¹¤¾ßÀ¸ÓÉ´ËÖªµÀ»¹ÓжàÓàµÄ°´Å¥£¬ÓÚÊÇÂíÉϽ«iItem×ֶμÓ1Ôٴη¢ËÍTBN_GETBUTTONINFO֪ͨÂ룬Èç´ËÑ­»·Ö±µ½Ä³Ò»´ÎÏûÏ¢µÄ·µ»ØÖµÊÇFALSEΪֹ¡£

Ϊʲô¹¤¾ßÀ¸²»ÖªµÀÐèÒª»ñÈ¡µÄ°´Å¥µÄÊýÁ¿£¬¶øÐèÒªÓɸ¸´°¿ÚÀ´È·¶¨ÄØ£¿ÕâÊÇÒòΪ¹¤¾ßÀ¸Ö»Î¬»¤À¸ÉÏÏÖ´æµÄ°´Å¥£¬µ±¹¤¾ßÀ¸Éϵ±Ç°ÓÐ10¸ö°´Å¥µÄʱºò£¬Èç¹ûÔÚÒ»×éTBN_GETBUTTONINFO֪ͨÂëÖзµ»ØÁË15¸ö°´Å¥£¬Õâ15¸ö°´Å¥ÖаüÀ¨ÁËÒѾ­ÔÚʹÓõÄ10¸ö°´Å¥ºÍ¿ÉÒÔÌí¼ÓÉÏÈ¥µÄÁíÍâ5¸ö°´Å¥£¬ÄÇô¹¤¾ßÀ¸¾Í»á½«Õâ15¸ö°´Å¥ºÍÀ¸ÉÏÏÖ´æµÄËùÓа´Å¥±È½Ï£¬²¢°ÑÏÖ´æµÄ10¸ö°´Å¥·ÅÔÚ¡°×Ô¶¨Ò幤¾ßÀ¸¡±¶Ô»°¿òµÄÓұߣ¬°ÑÊ£ÓàµÄ5¸ö·ÅÔÚ¶Ô»°¿òµÄ×ó±ß¡£

ÔÚÀý×ÓÖпÉÓõİ´Å¥×ܹ²ÊÇ16¸ö£¬Èç¹ûÔÚ³õʼ»¯µÄʱºòÖ»ÐèÒªÏÔʾǰÃæ10¸ö°´Å¥£¬ÄÇôÔÚʹÓÃCreateToolbarExº¯ÊýµÄʱºò¿ÉÒÔÖ»Ö¸¶¨10¸ö°´Å¥£¬ÔÚÕâÖÖÇé¿öÏ£¬µ±¶¨Öƹ¤¾ßÀ¸Ê±ÔÚÒ»×éTBN_GETBUTTONINFO֪ͨÂëÖзµ»ØÈ«²¿16¸ö°´Å¥µÄʱºò£¬¶àÓàµÄ6¸ö°´Å¥¾Í»á³öÏÖÔÚ¶Ô»°¿òµÄ×ó±ß¡£

ÁíÍ⣬TBNOTIFY½á¹¹µÄpszTextÐèÒª·µ»Ø°´Å¥µÄ˵Ã÷ÎÄ×Ö£¬·ñÔò¶Ô»°¿òÖÐ×óÓÒÁ½¸öÁбí¿òÖÐÖ»»áÏÔʾ°´Å¥Í¼Ïñ¶øûÓÐ˵Ã÷ÎÄ×Ö¡£³ÌÐòÔÚÕâÀïʹÓú͹¤¾ßÌáʾÐÅϢͬÑùµÄÎÄ×Ö£¬ÕâЩÎÄ×Ö´æ·ÅÔÚ×ÊÔ´ÖУ¬ËùÒÔÀý×Ó´úÂë´ÓTBNOTIFY½á¹¹°üº¬µÄTBBUTTON½á¹¹ÖÐÈ¡³öidmand×ֶΣ¬Ê¹ÓÃLoadStringº¯Êý´Ó×ÊÔ´ÖжÁÈ¡ÒÔidmandΪIDµÄ×Ö·û´®²¢½«Æä·ÅÈëpszTextËùÖ¸µÄ»º³åÇøÖУ¬×îºóʹÓÃlstrlenº¯ÊýÇó³ö×Ö·û´®µÄ³¤¶È²¢·ÅÈëcchText×Ö¶ÎÖУ¬ÕâÑù¶Ô»°¿òµÄÁбí¿òÖоͿÉÒÔÏÔʾ³ö°´Å¥µÄÃû³Æ×Ö·û´®ÁË¡£



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


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


9¡£3¡¡Ê¹Óù¤¾ßÀ¸£¨6£©

¡¡¡¡¡¡¡¡
2¡£¡¡¶¨Öƹ¤¾ßÀ¸

¶¨Öƹ¦ÄÜÊǹ¤¾ßÀ¸ÖÐ×îÁîÈËÐ˷ܵÄÌØÕ÷£ºµ±¹¤¾ßÀ¸°üº¬CCS_ADJUSTABLE·ç¸ñµÄʱºò£¬Óû§¿ÉÒÔͨ¹ý°´ÏÂShift¼ü²¢Í϶¯¹¤¾ßÀ¸Éϵİ´Å¥À´Òƶ¯°´Å¥Î»Öã»Èç¹û½«°´Å¥Íϳö¹¤¾ßÀ¸µÄ±ß½ç£¬°´Å¥»á±»É¾³ý£»¸üÖØÒªµÄÊÇ£¬Èç¹ûÏò¹¤¾ßÀ¸·¢ËÍTB_CUSTOMIZEÏûÏ¢»òÕßÔÚ¹¤¾ßÀ¸µÄ¿Õ°×´¦Ë«»÷Êó±ê£¬»áÏÔʾ³öÒ»¸öÈçͼ9¡£7ËùʾµÄ¡°×Ô¶¨Ò幤¾ßÀ¸¡±¶Ô»°¿ò£¬¶Ô»°¿òÓұߵÄÁбí¿òÖÐÁгöÁ˵±Ç°ÏÔʾÔÚ¹¤¾ßÀ¸Éϵİ´Å¥£¬×ó±ßÁбí¿òÁгöÁË¿ÉÒÔÌí¼Óµ½¹¤¾ßÀ¸Éϵİ´Å¥£¬Óû§¿ÉÒÔ½«Ò»¸ö°´Å¥ËæÒâÔÚʹÓúͲ»Ê¹ÓÃÖ®¼äÇл»£¬²¢ÇÒ¿ÉÒÔͨ¹ýÍ϶¯°´Å¥µÄÉÏÏÂλÖÃÀ´¾ö¶¨°´Å¥ÔÚ¹¤¾ßÀ¸ÉϵÄλÖá£

¹¤¾ßÀ¸Í¨¹ýһϵÁеÄ֪ͨÐÅÏ¢À´ºÍ¸¸´°¿Ú½»»¥£¬¹²Í¬Î¬»¤¡°×Ô¶¨Ò幤¾ßÀ¸¡±¶Ô»°¿ò£¬ÔÚÕâ¸ö¶Ô»°¿ò½¨Á¢ºÍ¹Ø±ÕµÄʱºò£¬¹¤¾ßÀ¸Í¨¹ýTBN_BEGINADJUSTºÍTBN_ENDADJUST֪ͨÂëÀ´Í¨Öª¸¸´°¿Ú£»Ã¿´Î°´Å¥±»µ÷ÕûµÄʱºò£¬·¢Ë͵ÄÊÇTBN_TOOLBARCHANGE֪ͨÂ룻ÔÚ°´Ï¶Ի°¿òÖеġ°°ïÖú¡±°´Å¥ºÍ¡°ÖØÖá±°´Å¥µÄʱºò£¬·¢Ë͵ÄÊÇTBN_CUSTHELPºÍTBN_RESET֪ͨÂ룬¶ÔÓÚÕâЩ֪ͨÂ룬¸¸´°¿Ú¿ÉÒÔ²»±ØÏìÓ¦£¬Õâ²¢²»»áÓ°Ïì¶Ô»°¿òµÄʹÓá£

Óë¶Ô»°¿òÊÇ·ñÄܹ»Õý³£ÔËÐÐÓйصÄ֪ͨÂëÊÇTBN_QUERYINSERT£¬TBN_QUERYDELETEºÍTBN_GETBUTTONINFO£¬¸¸´°¿Ú±ØÐëÓ¦´ðÕâЩ֪ͨÂë¡£


ͼ9¡£7¡¡¡¡×Ô¶¨Ò幤¾ßÀ¸¶Ô»°¿ò

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