°´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·ҳ£¬°´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ£¬°´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿£¡
¡ª¡ª¡ª¡ªÎ´ÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡
ÂÔ£¬ÕâÑùÏÂÃæµÄ·ÖÖ§¾Í¿ÉÒÔͬʱ´¦Àí²Ëµ¥ºÍ¼ÓËÙ¼üÏûÏ¢£¬µ±È»¶ÁÕßÒ²¿ÉÒÔÈ¥µôÕâÒ»¾ä£¬ÕâÑùÏÂÃæµÄ±È½ÏÓï¾äÖоÍҪʹÓÃax¶ø²»ÊÇeax¡£
ÔÚÀý×Ó³ÌÐòÖУ¬mov¡¡eax£»wParamÇ°Ã滹ÓÐÒ»¾äinvoke¡¡_DisplayMenuItem£»wParam£¬×÷ÓÃÊÇÔÚ´¦ÀíWM_MANDÏûϢǰ½«wParamµÄֵͨ¹ýÒ»¸ö¶Ô»°¿òÏÔʾ³öÀ´£¬¶ÁÕß¿ÉÒÔºÍ×ÊÔ´½Å±¾ÎļþÖж¨ÒåµÄÃüÁîIDÖµ¶Ô±Èһϣ¬ÔÚÕý³£Ê¹ÓõijÌÐòÖпÉÒÔÈ¥µôÕâÒ»¾ä¡£
¶ÁÕß¿ÉÒÔ·¢ÏÖ£¬×ÊÔ´ÎļþÖж¨ÒåµÄ¡°×ÖÌ塱²Ëµ¥ÏîµÄIDΪOx4201£¬µ±Ñ¡ÖС°×ÖÌ塱²Ëµ¥ÏîµÄʱºò£¬¶Ô»°¿òÖÐÏÔʾµÄwParamÊýÖµÕýÊÇ00004201£¬¶ø°´Ï¼ÓËÙ¼üAlt£«FµÄʱºò£¬ÏÔʾ³öÀ´µÄÖµ¾ÍÊÇ00014201ÁË£¬ËüÃǵÄÇø±ð¾ÍÊǸß16λÖеÄ֪ͨÂ벻ͬ¡£
¡¡
À´Ô´£ºµç×Ó¹¤Òµ³ö°æÉç¡¡×÷ÕߣºÂÞÔƱò¡¡ÉÏÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡»ØÊéÄ¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏÂÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ÉÏÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡»ØÊéÄ¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏÂÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡
µÚ5Õ¡¡Ê¹ÓÃ×ÊÔ´
5¡£1¡¡²Ëµ¥ºÍ¼ÓËÙ¼ü£¨6£©
¡¡¡¡¡¡¡¡
4¡£¡¡²Ëµ¥ÏîµÄÐÞ¸Ä
ÔÚ³ÌÐòµÄÔËÐÐÖÐÒ²¿ÉÒÔ¶¯Ì¬Ð޸IJ˵¥Ï°üÀ¨Ìí¼Ó¡¢É¾³ýºÍÐ޸IJÙ×÷£¬ÕâЩ²Ù×÷ÊÇͨ¹ý¼¸¸öAPIº¯ÊýÀ´Íê³ÉµÄ£º
invoke¡¡AppendMenu£»hMenu£»uFlags£»uIDNewItem£»lpNewItem¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»Ìí¼Ó²Ëµ¥Ïî
invoke¡¡InsertMenu£»hMenu£»uPosition£»uFlags£»uIDNewItem£»lpNewItem¡¡¡¡£»²åÈë²Ëµ¥Ïî
invoke¡¡ModifyMenu£»hMenu£»uPosition£»uFlags£»uIDNewItem£»lpNewItem¡¡¡¡£»Ð޸IJ˵¥Ïî
invoke¡¡DeleteMenu£»hMenu£»uPosition£»uFlags¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»É¾³ý²Ëµ¥Ïî
invoke¡¡RemoveMenu£»hMenu£»uPosition£»uFlags¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»É¾³ý²Ëµ¥Ïî
ÆäÖÐAppendMenuÓÃÀ´ÔÚÒ»¸ö²Ëµ¥µÄ×îºóÌí¼Ó²Ëµ¥ÏInsertMenuÔòÔÚÖмä²åÈë²Ëµ¥ÏModifyMenu¿ÉÒÔÐÞ¸ÄÒ»¸ö²Ëµ¥ÏîµÄÎÄ×Ö£¬DeleteMenuºÍRemoveMenuÔò¿ÉÒÔɾ³ýÒ»¸ö²Ëµ¥Ïî¡£
ÕâЩº¯ÊýÖеIJÎÊý¶¼ÊÇÀ×ͬµÄ£¬hMenu²ÎÊýÖ¸Òª²Ù×÷µÄ²Ëµ¥¾ä±ú£»uPositionÓÃÀ´¶¨Î»Òª²Ù×÷µÄ²Ëµ¥Ï¶¨Î»µÄ·½·¨ÓÐÁ½ÖÖ£ºÓÃÃüÁîID¶¨Î»»òÓÃλÖÃË÷Òý£¬ÓÃÄÄÒ»ÖÖ·½·¨È¡¾öÓÚºóÃæµÄuFlags²ÎÊý£¬µ±uFlagsΪMF_BYMANDʱ£¬uPostionΪ²Ëµ¥ÏîµÄÃüÁîID£¬¶øµ±uFlagsΪMF_BYPOSITIONµÄʱºò£¬uPostion±íʾ²Ëµ¥ÏîµÄλÖÃË÷Òý£¬Ë÷ÒýÊÇ´Ó0¿ªÊ¼µÄ£¬Ò²¾ÍÊÇ˵µÚÒ»¸ö²Ëµ¥ÏîµÄË÷ÒýֵΪ0¡£
AppendMenuº¯Êý×ÜÊÇÔڲ˵¥µÄ×îºóÌí¼ÓеIJ˵¥ÏËùÒÔ²»ÐèÒªuPostion²ÎÊý¡£
¶ÔÓÚAppendMenuºÍInsertMenu£¬»áÓÐÒ»¸öеIJ˵¥Ïî²úÉú£¬uIDNewItem¾Í±íʾÕâ¸öв˵¥ÏîµÄÃüÁîID£¬lpNewItemÖ¸Ïòв˵¥ÏîµÄÎÄ×Ö×Ö·û´®£¬ModifyMenuº¯Êý¿ÉÒÔÐÞ¸ÄÒ»¸ö²Ëµ¥ÏîµÄÃüÁîID»òÎÄ×Ö×Ö·û´®£¬ËùÒÔÒ²ÓÐuIDNewItemºÍlpNewItem²ÎÊý¡£¶øÓÃÀ´É¾³ý²Ëµ¥ÏîµÄDeleteMenuºÍRemoveMenuÏÔÈ»Óò»×ÅuIDNewItemºÍlpNewItem²ÎÊý¡£
uFlags²ÎÊý³ýÁËÖ¸¶¨MF_BYMAND»¹ÊÇMF_BYPOSITIONÍ⣬»¹¿ÉÒÔ×éºÏÖ¸¶¨²Ëµ¥ÏîµÄÆäËûÊôÐÔ£¬ÈçMF_CHECKED£¬MF_DISABLED£¬MF_ENABLED£¬MF_GRAYED£¬MF_MENUBARBREAK£¬MF_MENUBREAK£¬MF_SEPARATORºÍMF_UNCHECKEDµÈ£¬´ÓÆä×ÖÃæÉϾͿÉÒÔ¿´³öÕâЩÊôÐԵĺ¬Òå¡£
DeleteMenuºÍRemoveMenuµÄ²»Í¬Ö®´¦ÔÚÓÚ¶Ôpopup²Ëµ¥ÏîµÄ´¦Àí¡£µ±ËüÃÇÓÃÓÚpopupÊôÐԵIJ˵¥Ïîʱ£¬DeleteMenu²»½öɾ³ý²Ëµ¥Ï¶øÇÒ½«Õâ¸öpopup²Ëµ¥ÏîµÄËùÓÐ×ÓÏîÄ¿È«²¿É¾³ý£¬ÕâÑù£¬Õâ¸öpopup²Ëµ¥¾Í²»ÄÜÔÚ±ðµÄµØ·½¼ÌÐøʹÓ㻶øRemoveMenu½ö´Ó²Ëµ¥ÖÐÒÆÈ¥Õâ¸öpopup²Ëµ¥ÏÕû¸öpopup²Ëµ¥ÔÚÄÚ´æÖл¹ÊÇ´æÔڵġ£ÒÔMenu¡£asm³ÌÐòΪÀý£¬°´Êó±êÓÒ¼üµ¯³öµÄ²Ëµ¥Êµ¼ÊÉÏÊÇÖ÷²Ëµ¥Öеġ°²é¿´¡±²Ëµ¥Ï¼ÙÈçÓÃDeleteMenuɾ³ýÖ÷²Ëµ¥Öеġ°²é¿´¡±ÏîÄ¿£¬ÄÇô°´ÓÒ¼üÒ²¾Íµ¯²»³ö²Ëµ¥ÁË£¬¶øÓÃRemoveMenuɾ³ýÖ÷²Ëµ¥Öеġ°²é¿´¡±ÏîÄ¿£¬°´Êó±êÓÒ¼üÈÔÈ»¿ÉÒÔµ¯³ö²Ëµ¥¡£¶ÔÓÚ·ÇpopupÊôÐԵIJ˵¥ÏDeleteMenuºÍRemoveMenuµÄЧ¹ûÊÇͬÑùµÄ¡£
5¡£¡¡Ê¹ÓÃϵͳ²Ëµ¥
ϵͳ²Ëµ¥Ö¸°´ÏÂÁ˱êÌâÀ¸Í¼±êºóµ¯³öµÄ²Ëµ¥£¬ºÍ´°¿Ú²Ëµ¥²»Í¬£¬Ñ¡ÖÐϵͳ²Ëµ¥µÄ²Ëµ¥Ïîºó£¬WindowsÏò´°¿Ú·¢Ë͵ÄÊÇWM_SYSMANDÏûÏ¢¶ø·ÇWM_MANDÏûÏ¢¡£Ä¬ÈϵÄϵͳ²Ëµ¥ÖÐÒѾÓС°»¹Ô¡±¡¢¡°Òƶ¯¡±¡¢¡°´óС¡±¡¢¡°×î´ó»¯¡±¡¢¡°×îС»¯¡±ºÍ¡°¹Ø±Õ¡±µÈ²Ëµ¥ÏÕâЩ²Ëµ¥ÏîµÄÃüÁîIDÒѾԤ¶¨ÒåΪSC_RESTORE£¬SC_MOVE£¬SC_SIZE£¬SC_MAXIMIZE£¬SC_MINIMIZEºÍSC_CLOSEµÈ£¬Èç¹û¶ÁÕßÒª×Ô¼º´¦ÀíËüÃÇ£¬¿ÉÒÔÔÚWM_SYSMANDÏûÏ¢Öн¨Á¢Ò»¸ö±È½Ï·ÖÖ§¶ÔËüÃǽøÐд¦Àí£¬Ò»°ãÔÚ³ÌÐòÖв¢²»×Ô¼º´¦ÀíWM_SYSMANDÏûÏ¢£¬¶øÊǽ»¸øDefWindowProc´¦Àí¡£
ÈçºÎÔÚϵͳ²Ëµ¥ÖÐÌí¼Ó×Ô¼ºµÄ²Ëµ¥ÏîÄØ£¿·½·¨¾ÍÊÇʹÓÃÉÏÃæ½éÉܵÄAppendMenu£¨µ±È»Ò²¿ÉÒÔÓÃInsertMenu£©£¬ÔÚÌí¼ÓÇ°±ØÐëÓÃGetSystemMenuº¯ÊýÊ×ÏÈ»ñȡϵͳ²Ëµ¥µÄ¾ä±ú¡£Àý×Ó³ÌÐòÔÚ´°¿Ú³õʼ»¯µÄʱºòÔÚϵͳ²Ëµ¥Î²Ìí¼ÓÁËÒ»¸ö·Ö¸ôÏߺÍÁ½¸ö²Ëµ¥Ï¡°°ïÖúÖ÷Ì⡱ºÍ¡°¹ØÓÚ±¾³ÌÐò¡±£º
¡£if¡¡eax¡¡¡¡¡¡WM_CREATE
¡¡¡¡¡¡¡¡¡¡¡£¡£¡£
¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡GetSystemMenu£»hWnd£»FALSE
¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡@hSysMenu£»eax
¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡AppendMenu£»@hSysMenu£»MF_SEPARATOR£»0£»NULL
¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡AppendMenu£»@hSysMenu£»0£»IDM_HELP£»offset¡¡szMenuHelp
¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡AppendMenu£»@hSysMenu£»0£»IDM_ABOUT£»offset¡¡szMenuAbout
ÔÚ´°¿Ú¹ý³ÌÖд¦Àíϵͳ²Ëµ¥ÏûÏ¢µÄ·ÖÖ§½á¹¹Îª£º
¡£elseif¡¡eax¡¡¡¡¡¡WM_SYSMAND
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡eax£»wParam
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£if¡¡¡¡¡¡¡¡¡¡ax¡¡¡¡×Ô¶¨ÒåID1
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¡£¡£
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£elseif¡¡ax¡¡¡¡×Ô¶¨ÒåID2
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¡£¡£
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£else
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡DefWindowProc£»hWnd£»uMsg£»wParam£»lParam
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ret
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£endif
ºÍ´¦ÀíWM_MANDÏûÏ¢²»Í¬µÄÊÇ£¬ÔÚWM_SYSMANDÏûÏ¢Öд¦ÀíÁË×Ô¶¨ÒåµÄ²Ëµ¥ÃüÁîIDºó£¬±ØÐë°ÑÆäËûÃüÁîID½»¸øDefWindowProc´¦Àí£¬²¢Ö±½Ó°Ñ·µ»ØÖµ·µ»Ø¸øWindows£¬²»È»µÄ»°»á·¢ÏÖ´°¿Ú²»ÄÜÒƶ¯£¬²»Äܹرգ¬²»ÄÜ×îС»¯¡¡ÒòΪËüÏ൱ÓÚÆÁ±ÎÁËËùÓÐSC_RESTORE£¬SC_MOVE£¬SC_SIZE£¬SC_MAXIMIZE£¬SC_MINIMIZEºÍSC_CLOSEµÈÏûÏ¢µÄ´¦Àí¡£
6¡£¡¡ÓÒ¼üµ¯³ö²Ëµ¥
Àý×Ó³ÌÐòµÄÒ»¸ö¹¦ÄÜÊǵ±Óû§ÔÚ´°¿Ú¿Í»§Çø°´ÏÂÊó±êÓÒ¼üµÄʱºòµ¯³öÒ»¸ö²Ëµ¥£¬Õâ¸ö¹¦ÄÜÊÇÓÃTrackPopupMenuº¯ÊýʵÏֵġ£TrackPopupMenuº¯ÊýµÄÓ÷¨£º
invoke¡¡¡¡TrackPopupMenu£»hMenu£»uFlags£»x£»y£»nReserved£»hWnd£»lpRect
Õâ¸öº¯Êý±¾ÉíºÜ¼òµ¥£¬Ö´ÐкóÔÚ²ÎÊýÖ¸¶¨µÄx£¬yλÖõ¯³öÒ»¸öÊôÓÚhWnd´°¿Ú£¨Ò²¾ÍÊÇ˵WM_MANDÏûÏ¢·¢µ½Õâ¸ö´°¿Ú£©µÄ²Ëµ¥£¬²Ëµ¥¾ä±úÊÇhMenu¡£º¯ÊýÖеÄ×ø±êÊÇÒÔÕû¸öÆÁÄ»×óÉϽÇΪ»ù×¼µÄ£¬ËùÒÔµ¯³ö²Ëµ¥µÄλÖò»Ò»¶¨ÔÚ´°¿ÚµÄ¿Í»§ÇøÄÚ£¬Ëü¿ÉÒÔÊÇÆÁÄ»µÄÈκÎÒ»¸öµØ·½¡£
uFlags²ÎÊýÖ¸¶¨Ò»Ð©ºÍλÖÃÏà¹ØµÄÑ¡ÏËü¿ÉÒÔÊÇPM_CENTERALIGN£¬TPM_LEFTALIGN»òTPM_RIGHTALIGNÈýÕßÖ®Ò»£¬±íʾ£¨x£¬y£©×ø±êÊÇ´ú±íµ¯³ö²Ëµ¥Î»ÖõÄÖм䡢×óÉϽǻ¹ÊÇÓÒÉϽǣ¬Ò»°ãµÄÏ°¹ßÊÇʹÓÃTPM_LEFTALIGN£¬ÕâÑù²Ëµ¥»áÔÚÊó±êµã»÷´¦µÄÓұߵ¯³ö¡£uFlagsÖÐͬʱ»¹¿ÉÒÔÖ¸¶¨ÓÃÊó±ê×ó¼ü»¹ÊÇÓÒ¼üÑ¡¶¨²Ëµ¥Ï¶¨ÒåÖµ¿ÉÒÔÊÇTPM_LEFTBUTTON»òTPM_RIGHTBUTTON£¬Èç¹ûÑ¡ÔñTPM_RIGHTBUTTONµÄ»°£¬¶ÔÔڲ˵¥ÏîÉÏÃæ°´Êó±ê×ó¼üÊÇûÓз´Ó¦µÄ¡£
lpRectÖ¸ÏòÒ»¸öRECT½á¹¹£¬ÓÃÀ´Ö¸¶¨Ò»¸öÇøÓò£¬µ±²Ëµ¥µ¯³öºó£¬ÔÚÕâ¸öÇøÓòÍâµ¥»÷Êó±ê£¬²Ëµ¥²Å»áÏûʧ£¬Èç¹ûÕâ¸ö²ÎÊýÖ¸¶¨ÎªNULLµÄ»°£¬Ôڲ˵¥Ö®Íâµ¥»÷Êó±ê£¬²Ëµ¥¾Í»áÏûʧ¡£
ÔÚʹÓÃTrackPopupMenu֮ǰ£¬Óм¸¸ö×¼±¸¹¤×÷ÊÇÒª×öµÄ£ºÎªÁËÔÚ¿Í»§ÇøÖа´ÏÂÊó±êÓÒ¼üµ¯³ö²Ëµ¥£¬ÎÒÃǵ±È»Òª´¦ÀíÊó±êÓÒ¼üÏûÏ¢£¬Ò²¾ÍÊÇ˵ÔÚWM_RBUTTONDOWNÏûÏ¢Öе÷ÓÃTrackPopupMenuº¯Êý£¬Ò»°ãµÄÏ°¹ßÊÇÔÚÊó±ê°´Ïµĵط½µ¯³ö²Ëµ¥£¬ËùÒÔ»¹ÒªÊ×ÏÈ»ñÈ¡Êó±ê¹â±êµÄλÖã¬È»ºóÔÚ´ËλÖõ¯³ö²Ëµ¥¡£
Òª»ñÈ¡Êó±êλÖ㬿ÉÒÔÓÃGetCursorPosº¯Êý£º
invoke¡¡¡¡GetCursorPos£»lpPoint
²ÎÊýlpPointÖ¸ÏòÒ»¸öPOINTÊý¾Ý½á¹¹£¬Õâ¸ö½á¹¹Ö»ÓÐÁ½¸ö×ֶΣº
POINT¡¡STRUCT
x¡¡¡¡DWORD¡¡£¿
y¡¡¡¡DWORD¡¡£¿
POINT¡¡ENDS
¸Ã½á¹¹ÓÃÀ´±íʾһ¸öµãµÄ£¨x£¬y£©×ø±ê£¬GetCursorPos½«µ±Ç°µÄÊó±êλÖ÷µ»Øµ½Õâ¸ö½á¹¹ÖУ¬³ÌÐòÖеÄÏà¹Ø´úÂëÊÇ£º
local¡¡¡¡¡¡@stPos£ºPOINT¡¡¡¡¡¡¡¡£»Ê×Ïȶ¨ÒåÒ»¸öPOINT½á¹¹
¡£¡£¡£
invoke¡¡¡¡GetCursorPos£»addr¡¡@stPos¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»»ñÈ¡Êó±êλÖÃ
invoke¡¡¡¡TrackPopupMenu£»hSubMenu£»
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡TPM_LEFTALIGN£»@stPos¡£x£»@stPos¡£y£»NULL£»hWnd£»NULL
ÓÃGetCursorPos»ñÈ¡µÄÊó±êλÖÃÊÇÒ»¸öPOINT½á¹¹£¬µ«TrackPopupMenuÊäÈë×ø±êµÄ·½·¨ÊÇÓÃx£¬yÁ½¸ö²ÎÊý£¬¶ø²»ÊÇÒ»¸öPOINT½á¹¹£¬ËùÒÔÒªÓýṹÖеÄÁ½¸ö×Ö¶Î@stPos¡£xºÍ@stPos¡£y·Ö±ðÊäÈë¡£
ʹÓÃTrackPopupMenuʱҪעÒâµÄÊÇ£¬µ¯³öµÄ²Ëµ¥¾ä±ú±ØÐëÊÇpopupÀàÐ͵ģ¬¶øÔÚ×ÊÔ´ÎļþÖж¨Òå²¢ÇÒ¿ÉÒÔÓÃLoadMenuº¯Êý×°ÈëµÄ²Ëµ¥²¢²»ÊÇpopupÀàÐ͵ģ¬popup²Ëµ¥£¨ÈçÀý×ÓÖеġ°Îļþ¡±Óë¡°²é¿´¡±µÈ£©Ö»ÄÜÔÚµÚ¶þ²ãÖвÅÄܶ¨Ò壬ÔÚ³ÌÐòÖÐÓÃGetSubMenuµÃµ½µÄµÚ¶þ²ã×Ӳ˵¥µÄ¾ä±ú²ÅÊÇpopupÀàÐ͵ġ£GetSubMenuº¯ÊýµÄÓ÷¨ÊÇ£º
invoke¡¡¡¡GetSubMenu£»hMenu£»nPos
¡£if¡¡¡¡¡¡¡¡¡¡eax
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡hSubMenu£»eax
¡£endif
nPos²ÎÊýÖ¸¶¨Òª»ñÈ¡µÄ²Ëµ¥µÄλÖÃË÷Òý£¬GetSubMenuµÄ·µ»ØÖµÊÇ»ñÈ¡µÄ×Ӳ˵¥¾ä±ú¡£
Àý×ÓÓÃinvoke¡¡GetSubMenu£»hMenu£»1È¡µÃµÚ¶þ¸ö×Ӳ˵¥£¨¡°Îļþ¡±×Ӳ˵¥Îª0£¬¡°²é¿´¡±×Ӳ˵¥Îª1£¬¡¡£©µÄ¾ä±ú£¬È»ºóÔÚTrackPopupMenuÖÐʹÓã¬Õâ¸ö²Ëµ¥¾ä±ú¾ÍÊÇÖ÷²Ëµ¥Öеġ°²é¿´¡±²Ëµ¥£¬ËùÒÔ°´Êó±êÓÒ¼üµ¯³öµÄ²Ëµ¥ºÍÏÂÀ²Ëµ¥Öеġ°²é¿´¡±²Ëµ¥ÊÇһģһÑùµÄ¡£
¡¡
À