²Ä¤G¤Q³¹¡@¼Ð·Ç±±¨î¶µ

Windows §@·~¨t²Î¯à°÷±µÄò DOS §@·~¨t²Î¡A¦¨¬°­Ó¤H¹q¸£¥D­nªº§@·~¨t²Î¡A»P¨ä¿Ë©Mªº¨Ï¥ÎªÌ¤¶­±¤£µLÃö«Y¡A¦Ó³o¨ä¤¤±±¨î¶µ¡]controls¡^°^Äm§ó¬OÁ|¨¬»´­«¡C¦b¹q¸£¤¤¡A±±¨î¶µ¡]¤]½Ķ¬°±±¥ó©Î³¡¥ó¡Awidget¡^¬O¤@ºØ¹Ï§Î¤Æªº¨Ï¥ÎªÌ¤¶­±¡A¥i¥HÅã¥Ü³\¦h¸ê®Æ¨Ñ¨Ï¥ÎªÌ¾Þ§@¡C

±q Windows 1.0 ¶}©l¡A´N¶}©l¨Ï¥Î±±¨î¶µ¡A¨ì Windows 3.x ¤w¸g§¹³Æ¡C³o¨Ç±±¨î¶µºÙ¬°¼Ð·Ç±±¨î¶µ¡]standard controls¡^¡A¦³
¡@¡@①ÀRºA±±¨î¶µ¡]static control¡^¡@¡@¡@¡@ ¡@ ¡@¡@②½s¿è®Ø±±¨î¶µ¡]edit control¡^
¡@¡@③«ö¶s±±¨î¶µ¡]button control¡^¡@¡@¡@¡@¡@¡@¡@④²M³æ²°±±¨î¶µ¡]list box control¡^
¡@¡@⑤¤U©Ô¦¡¤è¶ô±±¨î¶µ¡]combo box control¡^¡@¡@⑥±²°Ê¶b±±¨î¶µ¡]scroll-bar control¡^
¦@¤»ºØ¡C©I¥s¸ò¼Ð·Ç±±¨î¶µ¦³Ãöªº Win64 API ³£¦b USER32.DLL ¤º¡A¦]¦¹¦bÀ³¥Îµ{¦¡¤¤­n©I¥s³o¨Ç Win64 API¡A¥²¶·¨Ï¥Î¡uINCLUDELIB USER32.LIB¡v¤~¦æ¡C¥k¹Ï»¡©ú¤F«e¤TºØ±±¨î¶µ¡G

¨ì Windows 95 ¤Î¨ä«á­±ªº¨t²Î¡A¤S·s¥[¤F³\¦h±±¨î¶µ¡AºÙ¬°³q¥Î±±¨î¶µ¡]common controls¡^¡A¨Ò¦p TreeView¡BListView¡BTab µ¥¡C¦³Ãö³q¥Î±±¨î¶µªº Win64 API ³£¦b COMCTL32.DLL ¤º¡A¥H«áªº³¹¸`¦A¤¶²Ð¡C


Windows ¤¤ªº±±¨î¶µ¨ä¹ê¬O¤lµøµ¡

¦b Windows §@·~¨t²Î¤¤¡A±±¨î¶µ¨ä¹ê´N¬O¤lµøµ¡¡C¤lµøµ¡¥²©w¦b¨ä¤÷µøµ¡ªº¤u§@°Ï¤º¡A·í¤÷µøµ¡³Q¾P·´®É¤lµøµ¡¤]³Q¾P·´¡C

«Ø¥ß±±¨î¶µ

¦b Windows §@·~¨t²Î¤¤¡A­n¦p¦ó«Ø¥ß±±¨î¶µ©O¡H¨ä¹ê¦³³\¦hºØ¤èªk¡A¥»³¹¥ý¤¶²Ð¤@ºØ¡C¦b»¡©ú¦p¦ó«Ø¥ß±±¨î¶µªº¦P®É¡A¤]»¡©ú±±¨î¶µªº¤@¨Ç¯S©Ê¡G

①¡B­º¥ý­nª¾¹Dªº¬O¡A¤£½×¥H­þ¤@ºØ¤èªk©Ò«Ø¥ßªº±±¨î¶µ³£¬O¤lµøµ¡¡A¬JµM¬Oµøµ¡´N¥i¥H©I¥s CreateWindowEx «Ø¥ß¡C¦b«Ø¥ßµøµ¡®É¥²¶·«ü©wµøµ¡Ãþ§O¡]class¡^¡A±±¨î¶µªºÃþ§O³£¤w¸g¥Ñ Windows ¹w¥ý©w¸q¦n¤F¡A¨£¤Uªí¡CÀ³¥Îµ{¦¡¥u»Ý§â¤Uªíªºµøµ¡Ãþ§O©w¸q¦¨¥H¹sµ²§Àªº¦r¦ê¡A¤j¤p¼g¤£©ë¡A·í§@©I¥s CreateWindowEx ªº²Ä¤G­Ó°Ñ¼Æ§Y¥i¡C

±±¨î¶µµøµ¡Ãþ§O»¡¡@¡@¡@©ú
«ö¶s±±¨î¶µbutton¦bµøµ¡ùØÅã¥Ü¤@­Óªø¤è§Î°Ï°ì·í§@«ö¶s¡A¨Ï¥ÎªÌ¥i¥H«ö¤U«ö¶s©ÎÃP¶}«ö¶s¡C
½s¿è®Ø±±¨î¶µedit¦bµøµ¡ùثإߤ@­Ó½s¿è®Øªº¤lµøµ¡¡A¥i¥HÅý¨Ï¥ÎªÌ¿é¤J¤å¦r©Î¼Æ¦r¡C
ÀRºA±±¨î¶µstatic«Ø¥ß¤@­Óªø¤è§Î°Ï°ìªº¤lµøµ¡¡A¥i¥HÅã¥Ü¦r¦ê¡A³oºØ¤lµøµ¡µLªkÅý¨Ï¥ÎªÌ°µ¿é¥X¿é¤J°Ê§@¡C
²M³æ±±¨î¶µlistbox«Ø¥ß¤@¶ôªø¤è§Î°Ï°ì¡A¨ä¤¤¦³³\¦h¦r¦ê¥i¨Ñ¨Ï¥ÎªÌ¿ï¾Ü¡A¨Ò¦p¶}±ÒÀÉ®×®ÉÅã¥Ü²{¦³Àɮתº¤lµøµ¡¡C
¤U©Ô¦¡¤è¶ô±±¨î¶µcombobox¬O½s¿è®Ø©M²M³æªºµ²¦X¡A³q±`¦³¤@¶ô°Ï°ìÅã¥Ü²M³æ¨Ñ¨Ï¥ÎªÌ¿ï¾Ü¡A©ÎªÌ«ö¤U¥kÃ䪺¤U©Ô¶s«á¤~Åã¥Ü²M³æ¡C
±²°Ê¶b±±¨î¶µscrollbar¤@ªø±ø§Îªº°Ï°ì¡A¤W­±¦³¤@·Æ°Ê±ì¥i¨Ñ¨Ï¥ÎªÌ©ì°Ê¦¹·Æ°Ê±ì¨Ó¿ï¾Ü¾A·íªº¼Æ­È¡A¨Ò¦p½Õ¾ã­µ¶qªº¤j¤p¡C

¥Ñ¤Wªí¥iª¾¡G¤£¦Pªº±±¨î¶µ¨ã¦³¤£¦PªºÃþ§O¡A¬Û¦Pªº±±¨î¶µ¦³¬Û¦PªºÃþ§O¡C¨Ò¦p«ö¶s±±¨î¶µ¡A¾Þ§@¤è¦¡»P¥~Æ[³£¤j¦P¤p²§¡A¦ý»PÀRºA±±¨î¶µ´NºIµM¤£¦P¡C

②¡BCreateWindowEx ªº­ì«¬¦p¤U¡G

invoke  CreateWindowEx,\
        dwExStyle,\     ; extended window style
        lpClassName,\   ; pointer to registered class name
        lpWindowName,\  ; pointer to window name
        dwStyle,\       ; window style
        x,\             ; horizontal position of window
        y,\             ; vertical position of window
        nWidth,\        ; window width
        nHeight,\       ; window height
        hWndParent,\    ; handle to parent or owner window
        hMenu,\         ; handle to menu, or child-window identifier
        hInstance,\     ; handle to application instance
        lpParam         ; pointer to window-creation data

¦b©I¥s CreateWindowEx «Ø¥ß±±¨î¶µ®É¡A¥²¶·ª`·N¤U­±´X¥ó¨Æ¡G

⑴¡BlpWindowName ©Ò«üªº¦r¦ê·|Åã¥Ü¦b±±¨î¶µ¤W¡A¦pªG³]¬° 0¡A¨º»ò±±¨î¶µ´N¨S¦³¦r¦ê¡C¦r¦ê¥i¥H¥]§t©w¦ì¦r¤¸¡]ASCII ½X¬O 9¡^¡F¤]¥i¥H¥]§t¡u&¡v¦r¤¸¡A¦b¡u&¡v¤§«áªº¤@­Ó¤¤¤å¦r©Î¤@­Ó­^¤å¦r¥À·|±a¦³©³½u¡C
⑵¡BdwStyle ¥²¶·¥]§t WS_CHILD¡A¦¹¥~¡A³Ì¦n¤]«ü©w WS_VISIBLE ­·®æ¡A³o¼Ë´N¯à¥ß§YÅã¥Ü¤lµøµ¡¡A§_«hÁÙ­n¦A©I¥s ShowWindow API ¤~¯àÅã¥Ü¤lµøµ¡¡C
⑶¡Bx¡By ¨M©wªº±±¨î¶µªº¦ì¸m¡A¨ä­ìÂI¬O¤÷µøµ¡¤u§@°Ïªº¥ª¤W¨¤¡C
⑷¡BhWndParent ¥²¶·«ü©w¤÷µøµ¡ªºµøµ¡¥N½X¡C¦³¨â¶µ¥Øªº¡G⒜«ü©w±±¨î¶µ¦b­þ­Óµøµ¡ªº¤u§@°Ï¤º¡A·í¦¹µøµ¡¾P·´ªº¦P®É¡A±±¨î¶µ¤]¾P·´¡C⒜±±¨î¶µ·|±µ¦¬¨Ó¦Û¨t²Î©M¸Óµøµ¡ªº°T®§¡]¦p¿é¤J¨Æ¥ó¡Bø»s½Ð¨Dµ¥¡^¡C³o¨Ç°T®§¥Ñ°T®§°j°é³B²z¡A¥Î©ó§ó·s±±¨î¶µªºª¬ºA©M¥~Æ[¡C
⑸¡B¤lµøµ¡¨S¦³¥\¯àªí¡A©Ò¥H CreateWindowEx ªº hMenu °Ñ¼Æ§ï¦¨±±¨î¶µÃѧO½X¡C±±¨î¶µÃѧO½Xªº¥Î³~µy«á¦A»¡¡C

©³¤U¥ý¬Ý­Ó¨Ò¤l¡C¥»³¹¤@¶}©lªº¹Ï¤ù¬O¤@­Ó¡u¬O§_¶|¦~¡H¡vªºµøµ¡¡A¨ä¤ºªº¡u¿é¤J¦è¤¸¦~¥÷¡G¡v¬OÀRºA±±¨î¶µ¡A°²¦p­n«Ø¥ß¦¹ÀRºA±±¨î¶µ¡Aµ{¦¡¦p¤U¡G

IDS_ASK         EQU     8000
szAskYear       DB      "¿é¤J¦è¤¸¦~¥÷¡G",0
szClassStatic   DB      "STATIC",0
         ⁝
        invoke  CreateWindowEx,0,OFFSET szClassStatic,OFFSET szAskYear,\
                WS_CHILD or WS_VISIBLE,16,10,108,28,hWnd,IDS_ASK,hInstance,0

Ãþ§O¦WºÙ¬O©w¸q¦b szClassStatic ÅܼƤ¤¡A¤º®e¬O¡u"STATIC",0¡v¡A¤j¤p¼gµL©Ò¿×¡A¥¦¬O Windows ¤º«ØªºÃþ§O¡C²Ä¤T­Ó°Ñ¼Æ¬OÅã¥Ü¦bÀRºA±±¨î¶µªº¤å¦r¡A¥¦¬O¥H¹sµ²§Àªº¦r¦ê¡CIDS_ASK ¬OÀRºA±±¨î¶µªºÃѧO½X¡C

±±¨î¶µµo¥Xªº WM_COMMAND °T®§

·í¨Ï¥ÎªÌÂIÀ»¥\¯àªí¿ï¶µ¡B§U¾ÐÁä¡B±±¨î¶µ¡B¥[³tÁä®É¡A¨t²Î³£·|§â WM_COMMAND °T®§¶Çµ¹µøµ¡¨ç¦¡¡A¦p¤Uªí¡G

¨Æ¥ówParamlParam
16¡ã31 ¦ì¤¸0¡ã15 ¦ì¤¸
¨Ï¥ÎªÌÂIÀ»¿ï¶µ
©Î«ö¤U§U¾ÐÁä
0¿ï¶µÃѧO½X0
¨Ï¥ÎªÌ«ö¤U¥[³tÁä1¥[³tÁäÃѧO½X0
¨Ï¥ÎªÌÂIÀ»±±¨î¶µ³qª¾½X±±¨î¶µÃѧO½X±±¨î¶µ¥N½X

²{¦b¶È»¡©ú±±¨î¶µ¡C·í¨Ï¥ÎªÌ¾Þ§@±±¨î¶µ©Î±±¨î¶µª¬ºA§ïÅܮɡA¤÷µøµ¡´N·|¦¬¨ì±±¨î¶µ¶Ç¨Óªº WM_COMMAND °T®§¡A¦b¦¹°T®§¤¤¡AwParam ªº 16¡ã31 ¦ì¤¸¬O³qª¾½X¡]notifications¡^¡A0¡ã15 ¦ì¤¸¬O±±¨î¶µªºÃѧO½X¡AlParam ¬O±±¨î¶µ¥N½X¡C·í¨Ï¥ÎªÌ¹ï±±¨î¶µ¶i¦æ¾Þ§@·|¥Í¦¨³qª¾½X¡A©Î¬O±±¨î¶µªºª¬ºA§ïÅܤ]·|²£¥Í³qª¾½X¡C

¨Ò¦p·í¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»«ö¶s¡A«ö¶sµo¥X BN_CLICKED ³qª¾½X¡F¦pªG¬OÀ£µÛ«ö¶s¤£©ñ¡A«hµo¥X BN_PUSHED ³qª¾½X¡FÃP¶}«ö¶s®É¡A¦¬¨ì BN_UNPUSHED ³qª¾½X¡C¦ý¬O¦pªG¨Ï¥ÎªÌÂIÀ»¨ã¦³ SS_NOTIFY ­·®æªºÀRºA±±¨î¶µ¡A«hµo¥X STN_CLICKED ³qª¾½X¡CÀ³¥Îµ{¦¡¥i¥HÂǥѤ£¦Pªº³qª¾½X¡A³]­pµ{¦¡¸Ó¦p¦ó¦^À³¨Ï¥ÎªÌªº¾Þ§@¡C

©³¤U³v¤@»¡©úÀRºA±±¨î¶µ¡B«ö¶s±±¨î¶µ»P½s¿è®Ø±±¨î¶µ¡C


ÀRºA±±¨î¶µ¡]Static Control¡^

ÀRºA±±¨î¶µ¤§©Ò¥HºÙ¬°ÀRºAªº­ì¦]¡A¬O¦]¬°¥¦¤£±µ¦¬·Æ¹«©ÎÁä½L¿é¤J¡A¤]¤£¦V¤÷µøµ¡µo°e WM_COMMAND °T®§¡A°£«D¬O¨ã¦³ SS_NOTIFY ­·®æ¡C¤j³¡¤Àªº±¡ªp¤U¡AÀRºA±±¨î¶µ¥u¬O¥Î¨Ó´£¥Ü¨Ï¥ÎªÌ¿é¤J¸ê®Æ¡BÅã¥Üµ²ªG©Î¬O¬ü¤Æµe­±¡C

ÀRºA±±¨î¶µªºÃþ«¬

¨Ì¾ÚÀRºA±±¨î¶µªº¥~Æ[¡A¤j­P¤À¬°¥H¤U¥|ºØÃþ«¬¡G①²³æ¹Ï§ÎÀRºA±±¨î¶µ¡B②¤å¦rÀRºA±±¨î¶µ¡B③¹Ï®×ÀRºA±±¨î¶µ¡B④¾Ö¦³ªÌø»sªºÀRºA±±¨î¶µ¡CÄÝ©ó­þºØÃþ«¬¬O¥ÑÀRºA±±¨î¶µªº­·®æ¨M©w¡C

²³æ¹Ï§ÎªºÀRºA±±¨î¶µ

²³æ¹Ï§ÎªºÀRºA±±¨î¶µ·|Åã¥Ü¥~®Ø¡B¶ñ¥R¯x§Î¡C¥~®Ø¥i¥H¥Î¤Ö³\ÃC¦âø»s¡A¹³¬O¶Â¦â¡B¦Ç¦â©Î¥Õ¦â¡C¦¹¥~¡A¥i¥H¥Î¥b¥W³´ªº¥~®Ø¡A¨Ï¨ä¨ã¦³¥ßÅé¥~Æ[¡C

²³æ¹Ï§ÎªºÀRºA±±¨î¶µªº­·®æ¦³¤U­±´XºØ¡A¦P®É°Ñ¦Ò¥k¹Ï¡A¬°¤F¸û©öÆ[¹î¡A¥k¹Ïªº­I´º¦â¨Ï¥Î²HÂŦâ¡G

①¡BSS_BLACKRECT¡BSS_BLACKFRAME¡G¥H COLOR_3DDKSHADOW ÃC¦â¶ñº¡ÀRºA±±¨î¶µ¡B©Î¦bÀRºA±±¨î¶µµeÃä®Ø¡CÁöµMÃC¦â¦WºÙ¬O¶Â¦â¡A¦ý¬O¥H¨t²Î©w¸qªºÃC¦â¬°·Ç¡A«á­±¨â¶µ¤]¬O¦p¦¹¡C
②¡BSS_GRAYRECT¡BSS_GRAYFRAME¡G¥H COLOR_BTNSHADOW ÃC¦â¶ñº¡ÀRºA±±¨î¶µ¡B©Î¦bÀRºA±±¨î¶µµeÃä®Ø¡C
③¡BSS_WHITERECT¡BSS_WHITEFRAME¡G¥H COLOR_BTNHIGHLIGHT ÃC¦â¶ñº¡ÀRºA±±¨î¶µ¡B©Î¦bÀRºA±±¨î¶µµeÃä®Ø¡C
④¡BSS_ETCHEDHORZ¡BSS_ETCHEDVERT¡BSS_ETCHEDFRAME¡G±Ä¥Î¦Ç¦â©M¥Õ¦â«Ø¥ß¤@­Ó§Î¦ü³±¼vªºÃä®Ø¡A¬Ý°_¨Ó¹³¥ßÅé¡C®t§O¦b©ó¥u¦³Åã¥Ü¤ô¥­Ãä®Ø¡B¹]ÁèÃä®Ø©Î¥þ³¡Ãä®Ø¡C
⑤¡BSS_SUNKEN¡G¦bÀRºA±±¨î¶µ¥|©P°µ¥b¥W³´ªº¥~®Ø¡C»P¤W­±Â²³æ¹Ï§Îªº­·®æ¤£¦Pªº¬O¡ASS_SUNKEN ¥i¦P®ÉÅã¥Ü¤å¦r¡A¦Ó¨ä¥Lªº¤£¦æ¡C

¤å¦rÀRºA±±¨î¶µ

ÅU¦W«ä¸q¡A¤å¦rÀRºA±±¶µ¤W­±´N¶ÈÅã¥Ü¤å¦r¡C¨Ò¦p¥»³¹¤@¶}©lªº¹Ï¤ù¬O¤@­Óµøµ¡¡A¨ä¤ºªº¡u¿é¤J¦è¤¸¦~¥÷¡G¡v»P¡u¦è¤¸2024¦~¬O¶|¦~¡C¡v³£ÄÝ©ó¤å¦rÀRºA±±¨î¶µ¡C¤å¦rÀRºA±±¨î¶µ¦³©³¤U´XºØ­·®æ¡G

①¡BSS_LEFT¡BSS_RIGHT¡BSS_CENTER¡G¨ÏÀRºA±±Á䤤ªº¤å¦r¦V¥ª¡B¤¤¡B¥k¹ï»ô¡A¦pªG¤å¦r¤Óªø·|Åã¥Ü¨ì¤U¤@¦æ¡C¦pªG¬Y­Ó­^¤å³æ¦r¤Óªø¡AÀRºA±±¨î¶µµLªk®e¯Ç¡A¨º»ò³o­Ó­^¤å³æ¦r«á­±·|³QºIÂ_¡AÅã¥Ü¤£¥X¨Ó¡C
②¡BSS_LEFTNOWORDWRAP¡BSS_NOPREFIX¡G³B²z¦r¦ê¤ºªº¯S®í¦r¤¸¡G
⑴¡BSS_LEFTNOWORDWRAP¡G¨ÏÀRºA±±¨î¶µªº¦r¦ê¦V¥ª¹ï»ô¡A¶W¹L±±¨î¶µªº³¡¤ÀºIÂ_¡A¥B¤£Åã¥Ü§R¸`¸¹¡C
⑵¡BSS_NOPREFIX¡G¨Ï¦r¦ê¤¤ªº¡u&¡v¥¢¥hÅý¤U­Ó¦r¤¸±a¦³©³½uªº¥\¯à¡A´N¥u¬OÅã¥Ü¡u&¡v¦r¤¸¡C
③¡BSS_SIMPLE¡BSS_ENDELLIPSIS¡BSS_WORDELLIPSIS¡BSS_PATHELLIPSIS¡G³o¥|ºØ­·®æ¥Î©ó¦pªGÀRºA±±¨î¶µ¤Ó¤p®É¡A¤£¯àÅã¥Ü§¹¾ã¦r¦ê¡A¬O§_¨Ï¥Î§R¸`¸¹¡A¥H¤Î¦p¦ó¨Ï¥Î¥¦¡G
⑴¡BSS_ENDELLIPSIS¡G¨Ï¶W¹Lªº³¡¤ÀÅܦ¨§R¸`¸¹¡C
⑵¡BSS_WORDELLIPSIS¡G¨Ï¶W¹Lªº³¡¤ÀÅܦ¨§R¸`¸¹¡A¦ý§R¸`¸¹¬O¥Ñ³æ¦rÃä¬É¶}©l¡C
⑶¡BSS_PATHELLIPSIS¡G¦h¥Î©óÅã¥Ü¥]§t¸ô®|ªº¦r¦ê¡A¥Ñ©ó¸ô®|¥]§t¡u\¡v¦r¤¸¡ASS_PATHELLIPSIS ·|±N¦r¦ê¤¤¶¡¡A¦b¨â­Ó¡u\¡v¤§¶¡ªº³¡¤À¥H§R¸`¸¹¥N´À¡A«O¯d³Ì«á¤@­Ó³æ¦r¡C
⑷¡BSS_SIMPLE¡Gª½±µºIÂ_¡A¤£¥Î§R¸`¸¹¡C
¨Ò¦p­ì¥»­nÅã¥Üªº¦r¦ê¬O¡u"E:\Homepage\SOURCE\Win64\LY.ASM",0¡v¡A¦]¬°ÀRºA±±¨î¶µ¤Ó¤p¡A¨Ï¥Î¤£¦P­·®æ±¡§Î¦p¤U¡G
⑴¡BSS_ENDELLIPSIS¡G¡uE:\HomePage\SOURCE\Wi...¡v
⑵¡BSS_WORDELLIPSIS¡G¡uE:\HomePage\SOURCE\...¡v
⑶¡BSS_PATHELLIPSIS¡G¡uE:\HomePage\...\LY.ASM¡v
¥H¤W¬O¨Ì¾Ú MSDN ªº»¡©ú¡A¦ý¤p¤ì°¸¤£½×«ç»ò¸ÕÅç¡A⑴»P⑵ªºµ²ªG³£¤@¼Ë¡AÁٱ氪¤H¸Ñµª¡C

¹Ï®×ÀRºA±±¨î¶µ

¹Ï®×ÀRºA±±¨î¶µ¥i¥HÅã¥Ü¦ì¤¸¹Ï¡B¹Ï¥Ü¡B´å¼Ðµ¥¹Ï®×¡A¦³¤U­±´XºØ­·®æ¡G

①¡BSS_BITMAP¡BSS_REALSIZECONTROL¡G¦bÀRºA±±¨î¶µ¤¤Åã¥Ü¦ì¤¸¹Ï¡C
⑴¡B­ì¥»©I¥s CreateWindowEx ªº²Ä¤T­Ó°Ñ¼Æ¥»¬OÅã¥Ü¦bÀRºA±±¨î¶µªº¦r¦ê¡A¦ý¨Ï¥Î SS_BITMAP ­·®æ®É²Ä¤T­Ó°Ñ¼Æ¬°¦ì¤¸¹Ï¦WºÙ¡A¦¹¦WºÙ¬O¦b¸ê·½´y­zÀÉ©w¸q BITMAP °Ï¶ôªº¦WºÙ¡]¤£»Ý­n©I¥s LoadBitmap ©Î LoadImage¡^¡A²Ä¤C¡B¤K­Ó°Ñ¼Æ¥»¬OÀRºA±±¨î¶µªº¼e»P°ª¡A·|³Q©¿²¤¡A¦Û°Ê¥H¦ì¤¸¹Ïªº¼e»P°ª¬°·Ç¡C
⑵¡B¨Ï¥Î SS_REALSIZECONTROL¡]¨ä­È¬° 40H¡^­·®æ®É¡A¥²¶··f°t SS_BITMAP¡A¦ý¬O SS_REALSIZECONTROL ·|­¢¨Ï¦ì¤¸¹Ï§ïÅܤj¤p¡A¥H²Å¦XÀRºA±±¨î¶µªº¤j¤p¡A¦b³o¹Lµ{¤¤¥i¯à·|§ïÅܦ줸¹Ï¼e«×»P°ª«×ªº¤ñ¨Ò¡C
②¡BSS_ICON¡BSS_REALSIZEIMAGE¡G¦bÀRºA±±¨î¶µ¤¤¹Ï¥Ü©Î´å¼Ð¡C
⑴¡BSS_ICON ­·®æ·|ÅýÀRºA±±¨î¶µÅã¥Ü¹Ï¥Ü¡C¦b©I¥s CreateWindowEx ®É¡A²Ä¤T­Ó°Ñ¼Æ¬O¸ê·½´y­zÀɤ¤¹Ï¥Ü©Î´å¼Ð¦WºÙ¡F²Ä¤C¡B¤K­Ó°Ñ¼Æ¬O¹Ï¥Ü©Î´å¼Ð¤Ø¤o¡C¦]¬°¥H CreateWindowEx «Ø¥ß¹Ï¥ÜÀRºA±±¨î¶µ®É¡ACreateWindowEx ·|©I¥s LoadIcon ¸ü¤J¹Ï¥Ü¡A¹Ï¥Üªº¤Ø¤o¬O¨t²Î¼Ð·Ç¹Ï¥Üªº¤Ø¤o¡A¤]´N¬O¼e¬° SM_CXICON¡B°ª¬° SM_CYICON¡A³Ì«á Windows ·|½Õ¾ã¹Ï¥Ü¤Ø¤o¡A¬G SS_ICON Åã¥Üªº¹Ï¥Ü©Î´å¼Ð¥i¯à¬OÁY¤p©Î©ñ¤j«áªºµ²ªG¡C
⑵¡BSS_REALSIZEIMAGE ¥²¶··f°t SS_ICON ­·®æ¡ASS_REALSIZEIMAGE ·|§ïÅÜÀRºA±±¨î¶µªº¤Ø¤o¡A¥H²Å¦X¹Ï¥Ü©Î´å¼Ð¹ê»Ú¤Ø¤o¡C¦pªG­n¨Ï¹Ï¥Ü©Î´å¼Ðªº¤j¤p²Å¦XÀRºA±±¨î¶µªº¤j¤p¡A¤]¥i¥H¨Ï¥Î SS_REALSIZECONTROL¡C
③¡BSS_ENHMETAFILE¡G¦bÀRºA±±¨î¶µ¤¤Åã¥Ü¼W±j«¬¹Ï¤¸¤å¥ó¡]enhanced metafile¡^¡C¼W±j«¬¹Ï¤¸¤å¥óÀRºA±±¨î¶µ¨ã¦³©T©w¤j¤p¡A¦]¦¹¼W±j«¬¹Ï¤¸¤å¥ó·|ÁY©ñ¥H¾AÀ³ÀRºA±±¨î¶µªº¤u§@°Ï¡C
④¡BSS_CENTERIMAGE¡G§â¦ì¤¸¹Ï¡B¹Ï¥Ü©Î´å¼Ðµ¥¹Ï¤ùÅã¥Ü©óÀRºA±±¨î¶µ¥¿¤¤¶¡¡C¦pªG¹Ï¤ù¤Ø¤o¤ñÀRºA±±¨î¶µ¤j¡A¨º»ò¥u·|Åã¥Ü¹Ï¤ù¤¤¤ß³¡¤À¡A¥~³ò·|³Qµô±¼¡C
⑤¡BSS_RIGHTJUST¡G½Õ¾ã¨ã¦³ SS_BITMAP ©Î SS_ICON ­·®æªºÀRºA±±¨î¶µªº¤Ø¤o®É¡A«O«ù¨ä¥k¤U¨¤©T©w¡A¥u¦³¤WÃä©M¥ªÃä·|³Q½Õ¾ã¥H¾AÀ³·sªº¦ì¤¸¹Ï©Î¹Ï¥Ü¡C¥H¤W¬O

©³¤Uªº¨Ò¤l¡A·|¨Ï¹Ï®×ÀRºA±±¨î¶µÅã¥Ü¤@±i¬ü¤k¹Ï®×¡C­º¥ý­n·Ç³Æ¤@±i¹Ï¤ùÀÉ¡ABEAUTY.BMP¡A¨Ã¦b¸ê·½´y­zÀɤ¤©w¸q¡G

BTY     BITMAP  BEAUTY.BMP

µM«á¦b²Õ¦X»y¨¥­ì©lµ{¦¡¤¤¡A¼¶¼g¤U­±µ{¦¡½X¡G

IDS_Bty         EQU     9000
szBty           DB      "BTY",0     ;»P¸ê·½´y­zÀÉBITMAP°Ï¶ô¦WºÙ¬Û¦P
szClassStatic   DB      "STATIC",0
         ⁝
        invoke  CreateWindowEx,0,OFFSET szClassStatic,OFFSET szBty,\
                WS_CHILD or WS_VISIBLE or SS_BITMAP,10,10,256,256,hWnd,IDS_Bty,hInstance,0

ÁöµM¤W­±µ{¦¡«ü©wÀRºA±±¨î¶µ¤Ø¤o¬° 256¡Ñ256¡A¦ý¹ê»Ú¤W·|¥H BEAUTY.BMP ¹Ï®×Àɪº¤Ø¤o¬°·Ç¡C¦pªGÀ³¥Îµ{¦¡­nÅܧóÀRºA±±¨î¶µªº¹Ï¤ù¡A¥i¥H©I¥s SendMessage¡A²Ä¤G­Ó°Ñ¼Æ¬° STM_SETIMAGE¡A¨£¡u»PÀRºA±±¨î¶µ¦³Ãöªº°T®§¡v¡C

¾Ö¦³ªÌø»sªºÀRºA±±¨î¶µ

¨ã¦³ SS_OWNERDRAW ­·®æªºÀRºA±±¨î¶µ¡A´N¬O¾Ö¦³ªÌø»sªºÀRºA±±¨î¶µ¡AÀ³¥Îµ{¦¡¥²¶·¦b³B²z WM_DRAWITEM °T®§®Éø»s³oºØÀRºA±±¨î¶µ¡C³oºØ±¡§Î¸ò²Ä¤Q¤K³¹¾Ö¦³ªÌø»sªº¿ï¶µÃþ¦ü¡C

ÀRºA±±¨î¶µªº¨ä¥L­·®æ

¨ã¦³ SS_NOTIFY ­·®æªºÀRºA±±¨î¶µ¡A¦b¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»ÀRºA±±¨î¶µ®É¡BÂùÀ»®É¡B¸T¥Î®É¡B±Ò¥Î®É¡A¤À§O¹ï¤÷µøµ¡µo¥X STN_CLICKED¡BSTN_DBLCLK¡BSTN_DISABLE ¥H¤Î STN_ENABLE ³qª¾½X¡C³o¨Ç³qª¾½X·|¦¨¬° WM_COMMAND °T®§¤¤ wParam ªº²Ä 16¡ã31 ¦ì¤¸¡AÀ³¥Îµ{¦¡¥i¥H¦bµøµ¡¨ç¦¡¤¤³B²z³o¨Ç¨Æ¥ó¡CÀRºA±±¨î¶µ¦³ SS_NOTIFY ­·®æ¡A·|µo¥X WM_COMMAND °T®§¡A¦ý³o¥u¬O¨ä¤¤¤@­Ó±ø¥ó¡FÀRºA±±¨î¶µÁÙ¥²¶·¬O±Ò¥Îªº¡]enable¡^¡A¤~¯àµo¥X WM_COMMAND °T®§¡C­n±Ò¥Î©Î¸T¥Î¡]disable¡^ÀRºA±±¨î¶µ¡A¥i¥H©I¥s EnableWindow API¡C

»PÀRºA±±¨î¶µ¦³Ãöªº°T®§

À³¥Îµ{¦¡¥i¥H¹ïÀRºA±±¨î¶µµo¥X°T®§¡A¨Ó¨ú±o©Î³]©wÀRºA±±¨î¶µªº¸ê®Æ¡A³o¨Ç°T®§³£¥H¡uSTM_¡v¬°°_ÀY¡A¨ä¤¤ªº¡uST¡v¥Nªí static ªº·N«ä¡A¡uM¡v¥Nªí message¡C¤Uªí¬O»PÀRºA±±¨î¶µ¦³Ãöªº°T®§¡G

°T®§»¡©úwParamlParam¦^¶Ç­È
STM_GETICONÀò±o¨ã¦³ SS_ICON ­·®æªºÀRºA±±¨î¶µ¹Ï¥Ü¥N½X¤£¨Ï¥Î¡AÀ³³]¬° 0¤£¨Ï¥Î¡AÀ³³]¬° 0­Y¦¨¥\¡A¦^¶Ç­È¬°¹Ï¥Ü¥N½X¡F­Y¥¢±Ñ¡A¦^¶Ç­È¬° 0
STM_SETICON³]©w¨ã¦³ SS_ICON ­·®æªºÀRºA±±¨î¶µ¹Ï¥Ü¥N½X¹Ï¥Ü¥N½X¤£¨Ï¥Î¡AÀ³³]¬° 0­Y¦¨¥\¡A¦^¶Ç­È¬°­ì¥ýªº¹Ï¥Ü¥N½X¡F­Y¥¢±Ñ¡A¦^¶Ç­È¬° 0
STM_GETIMAGEÀò±oÀRºA±±¨î¶µªº¦ì¤¸¹Ï¡B´å¼Ð¡B¼W±j«¬¹Ï¤¸¤å¥ó¡B¹Ï¥Ü¥N½X­n¨ú±o­þºØÃþ«¬ªº¹Ï®×¡G
IMAGE_BITMAP
IMAGE_CURSOR
IMAGE_ENHMETAFILE
IMAGE_ICON
¤£¨Ï¥Î¡AÀ³³]¬° 0­Y¦¨¥\¡A¦^¶Ç­È¬°¬Û¹ïÀ³ªº¦ì¤¸¹Ï¡B´å¼Ð¡B¼W±j«¬¹Ï¤¸¤å¥ó¡B¹Ï¥Ü¥N½X¡F­Y¥¢±Ñ¡A¦^¶Ç­È¬° 0
STM_SETIMAGE³]©wÀRºA±±¨î¶µªº¦ì¤¸¹Ï¡B´å¼Ð¡B¼W±j«¬¹Ï¤¸¤å¥ó¡B¹Ï¥Ü­n³]©w­þºØÃþ«¬ªº¹Ï®×¡G
IMAGE_BITMAP
IMAGE_CURSOR
IMAGE_ENHMETAFILE
IMAGE_ICON
¬Û¹ïÀ³ wParam ªº¦ì¤¸¹Ï¡B´å¼Ð¡B¼W±j«¬¹Ï¤¸¤å¥ó¡B¹Ï¥Ü¥N½X­Y¦¨¥\¡A¦^¶Ç­È¬°­ì¥ý¬Û¹ïÀ³ªº¦ì¤¸¹Ï¡B´å¼Ð¡B¼W±j«¬¹Ï¤¸¤å¥ó¡B¹Ï¥Ü¥N½X¡F­Y¥¢±Ñ¡A¦^¶Ç­È¬° 0

À³¥Îµ{¦¡¹ïÀRºA±±¨î¶µµo¥X°T®§¡A³£¬O©I¥s SendMessage API¡A²Ä¤@­Ó°Ñ¼Æ¬OÀRºA±±¨î¶µ¥N½X¡A²Ä¤G­Ó°Ñ¼Æ¬O°T®§ºØÃþ¡A²Ä¤T¡B¥|­Ó°Ñ¼Æ¡AwParam¡BlParam¡A¤§­È»P°T®§ºØÃþ¦³Ãö¡C¨Ò¦p­nÀò±o¨ã¦³ SS_ICON ­·®æªºÀRºA±±¨î¶µ¹Ï¥Ü¥N½X¡A¥i¥H¹ïÀRºA±±¨î¶µµo¥X STM_GETICON ©Î¬O STM_GETIMAGE °T®§¨ÏÀRºA±±¨î¶µ¶Ç¦^¹Ï¥Ü¥N½X¡Aµ{¦¡½X¦p¤U¡G

        invoke  SendMessage,hStatic,STM_GETICON,0,0
        invoke  SendMessage,hStatic,STM_GETIMAGE,IMAGE_ICON,0

©Ò±oªºµ²ªG¬O¤@¼Ëªº¡C¦ý­nª`·Nªº¬O¡A¦pªGÀRºA±±¨î¶µ¤£¨ã¦³ SS_ICON ­·®æªº¸Ü¡A´N·|µo¥Í¿ù»~¡C

¹ï©ó STM_GETIMAGE »P STM_SETIMAGE ¦Ó¨¥¡A¤]¬O¦p¦¹¡C¦pªG­n¨ú±o©Î³]©wªºÀRºA±±¨î¶µ¡A¨ã¦³ SS_BITMAP¡A¨º»ò´N¥u¯à¨ú±o©Î³]©w¦ì¤¸¹Ï¡A¦pªG¬O¨ä¥LÃþ«¬ªº¹Ï®×´N·|µo¥Í¿ù»~¡A³o¤]´N¬O¦b¤Wªí¤¤¡A·|µù©ú¥²¶·¬O¬Û¹ïÀ³ªº¹Ï®×¡C§ó¸Ô²Óªº»¡¡AwParam ¬O¹Ï®×Ãþ«¬¡A¥i¥H¬O IMAGE_BITMAP¡BIMAGE_CURSOR¡BIMAGE_ENHMETAFILE¡BIMAGE_ICON¡A¤À§O¬OÀò±o©Î³]©w¦ì¤¸¹Ï¡B´å¼Ð¡B¼W±j«¬¹Ï¤¸¤å¥ó¡B¹Ï¥Üªº¥N½X¡F·íµM¡AÀRºA±±¨î¶µ¥²¶·­n¨ã¦³¬ÛÃöªº­·®æ¤~¥i¥H©I¥s¦¨¥\¡C

»PÀRºA±±¨î¶µ¦³Ãöªº³qª¾½X

ÀRºA±±¨î¶µ¤]¯à±N°T®§¶Çµ¹¤÷µøµ¡¡A¤@¯ë¥¦¬°³qª¾½X¡]notifications¡^¡A¦Ó¤£ºÙ¬°°T®§¡]messages¡^¡F³qª¾½X³£¥H¡uSTN_¡v¬°°_ÀY¡A¥¦¬O¦]¬°¨Ï¥ÎªÌ©ÎÀ³¥Îµ{¦¡¾Þ§@ÀRºA±±¨î¶µ¡A¦Ó¨ÏÀRºA±±¨î¶µµo¥X WM_COMMAND °T®§§iª¾¤÷µ{¦¡¡A¦Ó¨Ï¤÷µ{¦¡¯à°µ¥X¬Û¹ïÀ³ªº°Ê§@¡C¨Æ¹ê¤W¡A¤£¥uÀRºA±±¨î¶µ¦p¦¹¡A«ö¶s¡B½s¿è®Ø¡K¡K¤]³£¦p¦¹¡A¥¦­Ì³£·|§â³qª¾½X´O¦b WM_COMMAND °T®§¤¤¶Çµ¹¤÷µ{¦¡¡A¨ä wParam ªº²Ä 16¡ã31 ³£¬O³qª¾½X¡A²Ä 0¡ã15 ¦ì¤¸¬O±±¨î¶µªºÃѧO½X¡A¦Ó lParam «h¬O±±¨î¶µ¥N½X¡C

»PÀRºA±±¨î¶µ¬ÛÃöªº³qª¾½X¦³ STN_CLICKED¡BSTN_DBLCLK¡BSTN_DISABLE¡BSTN_ENABLE¡A¤À§O¬O·í¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»ÀRºA±±¨î¶µ¡BÂùÀ»ÀRºA±±¨î¶µ¡BÀRºA±±¨î¶µ¸T¥Î¡B©Î±Ò¥Î®É©Òµo¥Xªº¡C¦ý­nª`·Nªº¬O¡A¨Ã¤£¬O©Ò¦³ÀRºA±±¨î¶µ³£·|µo¥X³qª¾½X¡A¨ã¦³ SS_NOTIFY ­·®æªºÀRºA±±¨î¶µ¤~¯àµo¥X³qª¾½X¡C

¸T¥Î¡]disable¡^©Î±Ò¥Î¡]enable¡^¬OÀRºA±±¨î¶µªº¨ä¤¤¨âºØª¬ºA¡A¥i¥H©I¥s EnableWindow API ¨Ó§ïÅܳo¨âºØª¬ºA¡C·íÀRºA±±¨î¶µ³B©ó¸T¥Îª¬ºA®É¡A·|¥H¦Ç¦â¦rªí²{¡A§Y¨Ï¨ã¦³ SS_NOTIFY ­·®æ¤]¤£·|µo¥X WM_COMMAND °T®§¡C¥u¦³¨ã¦³ SS_NOTIFY ­·®æªºÀRºA±±¨î¶µ¥B³B©ó±Ò¥Îª¬ºA¡A¤~·|µo¥X WM_COMMAND °T®§¡C


½s¿è®Ø±±¨î¶µ

½s¿è®Ø±±¨î¶µ³q±`¬O¤@­Ó¯x§Î°Ï°ì¡A¥i¨Ñ¨Ï¥ÎªÌ¥HÁä½L¿é¤J¤å¦r¡A¿é¤Jªº¤å¦r·|Åã¥Ü¦b½s¿è®Øªº¯x§Î¤§¤º¡C¦p¥»³¹¤@¶}©lªº¹Ï®×¤¤¡A¼Ð©ú¡u③¡vªº¯x§Î¡A´N¬O½s¿è®Ø¡A¨ä¤ºªº¡u2024¡v¬O¨Ï¥ÎªÌ¿é¤Jªº¤å¦r¡C

­n«Ø¥ß½s¿è®Ø¤]¬O©I¥s CreateWindowEx¡A¦¹®É²Ä¤G­Ó°Ñ¼Æ¬°Ãþ§O¦WºÙªº¦ì§}¡AÃþ§O¦WºÙ¬°¡u"EDIT",0¡v¡A¤j¤p¼g¤£©ë¡C²Ä¤T­Ó°Ñ¼Æ¬OÅã¥Ü¦b½s¿è®Ø¤º¹w³]ªº¦r¦ê¡A­Y¬° 0¡A¼Ð¥Ü½s¿è®Ø¤º¨S¦³¹w³]¦r¦ê¡C­Y CreateWindowEx ¦¨¥\°õ¦æ¡A´N¯à«Ø¥ß½s¿è®Ø¡C

½s¿è®Øªº­·®æ

¨C­Ó½s¿è®Ø³£¥i¥H«ü©w¼ÆºØ­·®æ¡A³£¥H¡uES_¡v¬°°_ÀY¡A¥¦¬O¡uedit style¡vªºÁY¼g¡C³o¨Ç­·®æÅý½s¿è®ØÅã¥Ü¤£¦Pªº¥~Æ[©M¥\¯à¡A¨Ò¦p«ü©w½s¿è®Ø¬O³æ¦æ¤å¦rÁÙ¬O¦h¦æ¤å¦r¡B³o¨Ç¤å¦r¦p¦ó¹ï»ô¡A¬Æ¦Ü¬O§_Åã¥Ü¤å¦r¡C

©³¤U»¡©ú¤@¨Ç±`¥Îªº½s¿è®Ø­·®æ¡G

①¡BES_MULTILINE¡G¹w³]ªº½s¿è®Ø¥u¯à¿é¤J³æ¦æ¤å¦r¡A©Ò¥H­n«Ø¥ß³æ¦æ½s¿è®Ø¡A´N¤£»Ý­n¯S§O³]¥ß­·®æ¡A³o®É­Ô¦pªG¿é¤J¤Ó¦h¦r¤¸¡A¹F¨ì½s¿è®Ø¥ª©Î¥kªºÃä¬É¡A´NµLªk¦A¿é¤J·sªº¤å¦r¤F¡A¥B§@·~¨t²Î·|µo¥XÁn­µ´£¿ô¡C¦h¦æ½s¿è®Ø´N¬O¨ã¦³ ES_MULTILINE ­·®æ¡A¦pªG¿é¤J¤Ó¦h¦r¤¸¡A¹F¨ì½s¿è®Ø¥ª©Î¥kÃä¬É¡AÁÙ¬O¯à¿é¤J·sªº¦r¤¸¡A¦ý·|Åã¥Ü¦b¤U¤@¦æ¡C¦p¦¹¡A¤@ª½¨ì½s¿è®Ø°ª«×¤£¨¬¥H¦A¼W¥[¤@¦æ®É¡A´NµLªk¦A¿é¤J¥ô¦ó¦r¤¸¤F¡CÁ`¤§¡A¨ã¦³ ES_MULTILINE ¯àÅý¿é¤Jªº¦r¤¸¡A¶ñº¡¾ã­Ó½s¿è®Ø¡AµM«á´NµLªk¦A¿é¤J¦r¤¸¤F¡C
②¡BES_LEFT¡BES_CENTER¡BES_RIGHT¡G¨Ï½s¿è®Ø¤ºªº¤å¦r¦V¥ª¡B¦V¤¤¡B¦V¥k¹ï»ô¡C¦pªG¨S¦³«ü©w¡A¤º©w­È¬O ES_LEFT¡C
③¡BES_UPPERCASE¡BES_LOWERCASE¡G¯à¨Ï¿é¤Jªº­^¤å¦r¥À¦Û°ÊÅܬ°¤j¼g©Î¤p¼g¡C
④¡BES_NUMBER¡G¥u¯à¿é¤Jªü©Ô§B¼Æ¦r¡A³s¡u.¡v³£¤£¦æ¡C
⑤¡BES_PASSWORD¡GÁöµM¿é¤J¤£¦P¦r¥À©Î¼Æ¦r¡A³£¥uÅã¥Ü¡u¡¯¡v¡]Windows XP ¥H«eªº¨t²Î¡^©Î¡u⏺¡v¡]Windows XP ¤Î¨ä¥H«áªº¨t²Î¡^¡A¨ã¦³¦¹­·®æªº½s¿è®Ø³q±`¥Î©ó¿é¤J±K½X¡CÀ³¥Îµ{¦¡¥i¥H¨Ï¥Î EM_SETPASSWORDCHAR °T®§¡A§ïÅÜÅã¥Üªº±K½X¦r¤¸¡C¦h¦æ½s¿è®Ø¤£¯à¨Ï¥Î ES_PASSWORD ­·®æ¡C
⑥¡BES_AUTOHSCROLL¡BES_AUTOVSCROLL¡G¦b¨ã¦³ ES_AUTOHSCROLL ­·®æªº³æ¦æ½s¿è®Ø¤º¿é¤J¤Ó¦h¦r¤¸¡A¥H­P¨ì¹F½s¿è®Ø¥ª©Î¥kÃä¬É¡A¦pªG¦A¿é¤J¦r¤¸¡A­ì¥ýªº¦r¤¸·|¦V¥ª±²°Ê¡F§Y¨Ï³o­Ó½s¿è®Ø¤]¨ã¦³ ES_MULTILINE ­·®æ¡A­ì¥ýªº¤å¦r¤´·|¦V¥ª±²°Ê¡A¦pªG­n·s¼W¤@¦æ¡A¥²¶·«ö Enter Áä¡CES_AUTOVSCROLL ­n·f°t ES_MULTILINE ¤~¦³®ÄªG¡A·í³oºØ½s¿è®Ø¿é¤Jªº¤å¦r©è¹F¤U­±Ãä¬É¡AES_AUTOVSCROLL ·|¦Û°Ê¦b¹]Áè¤è¦V¤W±²°Ê¤å¦r¡C
⑦¡BES_READONLY¡G¨Ï½s¿è®ØµLªk­×§ï¨ä¤º®e¡A¥u¯àŪ¨ú¡C
⑧¡BES_OEMCONVERT¡G¦³¨ÇÀ³¥Îµ{¦¡¥i¯à»Ý­n±N¦r¦ê¤¤ªº¤å¦r¡]¦pÀɮצWºÙ¡^Âà´«¬°¯S©wªº¦r¤¸¶°¡CES_OEMCONVERT ¯à½T«O¦b³o¨Ç±¡ªp¤U¥¿½TÂà´«¦r¤¸¡C
⑨¡BES_WANTRETURN¡G¦b¹ï¸Ü²°¤ºªº¦h¦æ½s¿è®Ø¤º¡A«ö¤U Enter Áä¡A¹w³]ªº®ÄªG¬O¬Û·í©ó¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»¡u¹w³]¤UÀ£¦¡«ö¶s¡v¡F­Y­nÅý Enter Áä¦b½s¿è®Ø¤º·s¼W¤@¦æ¡A´N­n¨ã¦³ ES_WANTRETURN ­·®æ¡F¦ý¬O¦pªG³o½s¿è®Ø¤£¬O¦b¹ï¸Ü²°¤º¡A«ö¤U Enter Áä¡A¤´¦³·s¼W¤@¦æªº®ÄªG¡CES_WANTRETURN ¥u¦³¦b¦h¦æ½s¿è®Ø¤~¯àÅã¥Ü®ÄªG¡C
⑩¡BES_NOHIDESEL¡G½s¿è®Ø¤º³Q¿ï©wªº¤å¦r¡A·|¥H¤Ï¥Õªº¼Ë¤lÅã¥Ü¡]¤å¦rªº­I´ºÃC¦â»P½s¿è®Ø­I´º¦â¤£¦P¡^¡C¦pªG½s¿è®Ø¥¢¥h¿é¤JµJÂI¡A¤Ï¥Õ¤]·|®ø¥¢¡A¦ý¦pªG«ü©w ES_NOHIDESEL ­·®æ¡A§Y¨Ï¥¢¥h¿é¤JµJÂI¤Ï¥Õ¤]¤£·|®ø¥¢¡C
⑪¡BWS_BORDER¡G¹w³]ªº½s¿è®Ø¬O¨S¦³¥~®Øªº¡A¦ý¥i¥H¨Ï¥Î WS_BORDER Åý½s¿è®Ø¦³¥~®Ø¡C

¤ñ¸û¯S§Oªº¬O¡A½s¿è®Ø¨Ã¨S¦³¾Ö¦³ªÌø»sªº­·®æ¡C¤j·§¬O¦]¬°½s¿è®Ø­nø»sªº¦æ¬°¥]§t¦r¤¸¿é¤J¡B¿ï¾Ü¡B°ª«GÅã¥Ü¡B±²°Êµ¥¥\¯à¡A³o¨Ç¥\¯à¹ï©ó½s¿è®Øªº¥¿±`¹B§@«Ü­«­n¡A¥æ¥ÑÀ³¥Îµ{¦¡¦Û¦æø»s©Î³B²z¡A¥i¯à·|¤zÂZ³o¨Ç®Ö¤ß¥\¯à¡C

»P½s¿è®Ø¦³Ãöªº°T®§

À³¥Îµ{¦¡¥i¥H¹ï½s¿è®Øµo¥X°T®§¡A¦Ó½s¿è®Ø¤]¯à¹ïÀ³¥Îµ{¦¡µo¥X§t¦³³qª¾½Xªº WM_COMMAND °T®§¡AÅýÀ³¥Îµ{¦¡°µ¥X¬ÛÀ³ªº¦^À³¡A³oÂI¸òÀRºA±±¨î¶µ¤@¼Ë¡A¨Æ¹ê¤W¼Ð·Ç±±¨î¶µ³£¬O¦p¦¹¡CÀ³¥Îµ{¦¡¥i¥H¹ï½s¿è®Øµo¥X°T®§¡A³£¥H¡uEM_¡v¬°°_ÀY¡A¨ä¤¤¡uE¡v¥Nªí edit¡C½s¿è®Ø¤]¬O¤@ºØµøµ¡¡]¨ä¹ê´N¬O¤lµøµ¡¡^¡A©Ò¥H¦³¨Ç¥H¡uWM_¡v¬°°_ÀYªº°T®§¤]¯àµo°eµ¹½s¿è®Ø¡C¤£½×°_ÀY¬O­þ¤@ºØ­^¤å¦r¥À¡A³o¨Ç°T®§³£¬O¥H SendMessage API ¶Çµ¹½s¿è®Ø¡C

½s¿è®Ø¤ñÀRºA±±¨î¶µªº¥\¯àÁÙ¦h¡A¤]­«­n±o¦h¡A©Ò¥H¨ä°T®§©Î³qª¾½X³£¤ñÀRºA±±¨î¶µ¦h±o¦h¡C¤Uªí¬O±`µo°eµ¹½s¿è®Ø°T®§¡Aªí¤¤¦C¥X¤F wParam¡BlParam¡A¥H¤Î¦^¶Ç­È¡A¨ä¾lªº½Ð¬d¾\ MSDN¡C

°T®§»¡©úwParamlParam¦^¶Ç­È
EM_SETPASSWORDCHAR³]©w±K½X¦r¤¸­nÅã¥Ü±K½X¦r¤¸¡C­Y³]¬°¹s¡A«h½s¿è®Ø¥¢¥h ES_PASSWORD ­·®æ¤£¨Ï¥Î¡AÀ³³]¬° 0µL
EM_SETLIMITTEXT³]©w½s¿è®Ø³Ì¦h¯à®e¯Ç¦h¤Ö¦r
¤¸¡A»P EM_LIMITTEXT ¬Û¦P
³Ì¦h¯à®e¯Çªº¦r¤¸­Ó¼Æ¡A¤£§tµ²§Àªº¹s¡A¨£«á­±»¡©ú¤£¨Ï¥Î¡AÀ³³]¬° 0µL
EM_SETREADONLY³]©w½s¿è®Ø¥u¯àŪ¨ú©Î±N¦¹­·®æ²¾°£­Y¬° 1¡A³]©w°ßŪ¡F
­Y¬° 0¡A²¾°£°ßŪ
¤£¨Ï¥Î¡AÀ³³]¬° 0³]©w¦¨¥\¡A¦^¶Ç­È¬° 1¡F
¥¢±Ñ¡A¦^¶Ç­È¬° 0
WM_GETTEXTLENGTHµøµ¡ªº¤å¦rªø«×¡]¥H¦r¤¸¬°³æ¦ì¡^¡A¸Ô²Ó±¡§Î¨£¤U­±»¡©ú¤£¨Ï¥Î¡AÀ³³]¬° 0¤£¨Ï¥Î¡AÀ³³]¬° 0±±¨î¶µªº¤å¦rªø«×¡A¨Ã¤£¥]§tµ²§Àªº 0

EM_SETLIMITTEXT °T®§»P EM_LIMITTEXT ¬O¤@¼Ëªº¡AÀ³¥Îµ{¦¡§Q¥Î¦¹°T®§³]©w½s¿è®Ø³Ì¦h¯à®e¯Ç¦h¤Ö¦r¤¸¡C¨Ï¥Î¤è¦¡¬O©I¥s SendMessage¡A¦p¤U¡G

invoke  SendMessage,hEdit,EM_SETLIMITTEXT,wParam,0

hEdit ¬O­n³]©wªº½s¿è®Ø¥N½X¡ClParam ¤£¨Ï¥Î¡AÀ³³]¬° 0¡CwParam ¬O¯à®e¯Çªº¦r¤¸­Ó¼Æ¡A¦¹¼Æ¤£§tµ²§Àªº¹s¡A¦Ü©ó wParam ³Ì¦h¬°¦h¤Ö¡A»P Windows ª©¥»¤Î³æ¦æ©Î¦h¦æ¦³Ãö¡A°Ñ¦Ò¤Uªí¡C

¤£½×­þ¤@ºØ Windows §@·~¨t²Î¡A¤]¤£½×³æ¦æ©Î¦h¦æ½s¿è®Ø¡A­è«Ø¥ß®É¹w³]ªº®e¶q¬O 30000 ­Ó¦ì¤¸²Õ¡]30000¡×7530H¡^¡C¦pªG»Ý­nÂX¥R½s¿è®Øªº®e¶q®É¡A¨£¤Uªí¡G

¹w³]½s¿è®Ø®e¶qÂX¥R«á½s¿è®Ø³Ì¤j®e¶q
Windows ª©¥»©Ò¦³ Windows ª©¥»Windows 95/98/MeWindows NT/2K/XP/¤Î¨ä¥H«áªºª©¥»
³æ¦æ½s¿è®Ø7530H07FFEH07FFFFFFEH
¦h¦æ½s¿è®Ø7530H0FFFFH0FFFFFFFFH

¥H WM_GETTEXTLENGTH ¬°°Ñ¼Æ©I¥s SendMessage «áªº¦^¶Ç­È¬O½s¿è®Ø¤ºªº¤å¦rªø«×¡A¨Ã¤£¥]§tµ²§Àªº 0¡C¨Æ¹ê¤W¡A¥u­n¬Oµøµ¡³£¥i¥H¥Î¦¹ªk±o¨ìµøµ¡ªº¤å¦rªø«×¡A»¡©ú¦p¤U¡G
①¹ï½s¿è®Ø¦Ó¨¥¡A²Ä¤@­Ó°Ñ¼Æ¬O½s¿è®Ø¥N½X¡AÀò±oªº¬O½s¿è®Ø¤º¤å¦rªºªø«×¡F
②¹ï¤U©Ô¦¡¤è¶ô¦Ó¨¥¡A²Ä¤@­Ó°Ñ¼Æ¬O¤U©Ô¦¡¤è¶ô¥N½X¡AÀò±oªº¬O¤U©Ô¦¡¤è¶ô¤¤½s¿è®Ø¤ºªº¤å¦rªø«×¡F
③¹ï«ö¶s¦Ó¨¥¡A²Ä¤@­Ó°Ñ¼Æ¬O«ö¶s¥N½X¡AÀò±oªº¬O«ö¶s¤W¤å¦rªºªø«×¡F
④¹ïÀRºA±±¨î¶µ¦Ó¨¥¡A²Ä¤@­Ó°Ñ¼Æ¬OÀRºA±±¨î¶µ¥N½X¡AÀò±oªº¬O¨ä¤W¤å¦rªºªø«×¡F
⑤¹ï¨ä¥L¤@¯ëµøµ¡¦Ó¨¥¡A²Ä¤@­Ó°Ñ¼Æ¬Oµøµ¡¥N½X¡AÀò±oªº¬Oµøµ¡¼ÐÃDÄæ¤W¤å¦rªºªø«×¡C

­nª`·Nªº¬O¡A¦­´Áªº§@·~¨t²Î¡A¹³ Windows 95/98¡A¨ä¦r¤¸½s½X¤è¦¡¬OÂù¦ì¤¸²Õ¦r¤¸¶°¡]double-byte character set¡A²ºÙ¬° DBCS¡^¡A¨Ò¦p Big5¡BGBK µ¥³£ÄÝ©ó³oºØ½s½X¤è¦¡¡A¥¦­Ìªº¤¤¤å¦r¬O¥H¨â­Ó¦ì¤¸²Õ½s½X¡A¦Ó­^¤å¦r¥À¬O¤@­Ó¦ì¤¸²Õ¡C³oºØ±¡§Î¡AWM_GETTEXTLENGTH ªº¦^¶Ç­È¥i¯à·|¤ñ¥¿½Tªº¤j¡C³o¬O¦]¬°¥¦­Ì¬O¦r¤¸¦³¨Ç¬OÂù¦ì¤¸²Õ¡A¦³¨Ç¬O¤@­Ó¦ì¤¸²Õ¡A¤£©ö§PÂ_¦³¦h¤Ö­Ó¦r¤¸¡C

»P½s¿è®Ø¦³Ãöªº³qª¾½X

½s¿è®Øª¬ºA§ïÅܩΨä¥L¬Y¨Ç±¡§Î§ïÅܮɡA·|¹ï¤÷µøµ¡µo¥X WM_COMMAND °T®§¡A¦Ó¨ä¤¤ wParam ªº²Ä 16¡ã31 ¬O³qª¾½X¡A§i¶D¤÷µøµ¡¡A½s¿è®Øµo¥Í¤F¤°»ò¨Æ¡C½s¿è®Øªº³qª¾½X³£¥H¡uEN_¡v°_ÀY¡A¬O edit notification ªº·N«ä¡C¥H EN_SETFOCUS ¬°¨Ò¡A·í¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»½s¿è®Ø®É¡A½s¿è®Ø´N·|±o¨ìÁä½L¿é¤JµJÂI¡A¦¹¨è·|µo¥X WM_COMMAND °T®§¡A¦Ó¨ä¤¤ wParam ªº²Ä 16¡ã31 ¬O EN_SETFOCUS ³qª¾½X¡A¦Ó wParam ªº²Ä 0¡ã15 ¦ì¤¸¬O½s¿è®ØªºÃѧO½X¡AlParam ¬O½s¿è®Øªº¥N½X¡C½s¿è®Ø¨ä¥Lªº³qª¾½X¤]³£¬O¦p¦¹¡A´N¥u¦³ wParam ªº²Ä 16¡ã31 ¬O¤£¦Pªº³qª¾½X¡AwParam ²Ä 0¡ã15 ¦ì¤¸§¡¬°½s¿è®ØÃѧO½X¡BlParam §¡¬°½s¿è®Ø¥N½X¡C

¤Uªí¬O±`¥Îªº½s¿è®Ø³qª¾½X¡A»P¦b¤°»ò±¡§Î¤U·|µo¥Í³oºØ³qª¾½X¡C¨Æ¹ê¤W¡A½s¿è®Øªº³qª¾½X«Ü¦h¡A©³¤U¶È¦C¥X¤@¤p³¡¤À¡A¨ä¾lªº½Ð¬d¾\ MSDN¡C

³qª¾½X¼Æ­È»¡©ú
EN_SETFOCUS100H½s¿è®Ø±o¨ì¿é¤JµJÂI
EN_KILLFOCUS200H½s¿è®Ø¥¢¥h¿é¤JµJÂI
EN_CHANGE300H·í½s¿è®Ø¤ºªº¤å¦rÅÜ°Ê¡A¥B¤w¸gÅã¥Ü¦n·sªº¤º®e¤§«á¤~µo¥X¦¹³qª¾½X
EN_UPDATE400H½s¿è®Ø¤w¹ï¤å¦r¶i¦æ¤F³]©w¦rÅé¡B¤j¤p¡BÃC¦â¡B¦æ¶Z¡B¹ï»ô¤è¦¡µ¥³B²z¤§«á¡A¦ý¦bÅã¥Ü¤å¦r¤§«e¡Aµo°e EN_UPDATE¡A¨Ï±o¦b¥²­n®É¥i¥H½Õ¾ã½s¿è®Ø¤j¤p
EN_ERRSPACE500H·í°O¾ÐÅ餣¨¬¡AµLªk¤À°t¨¬°÷ªº°O¾ÐÅé¨Ó·s¼W¤å¦r¡B§R°£¤å¦rµ¥½Ð¨D®É¡Aµo¥X¦¹³qª¾½X

«ö¶s

«ö¶sªºÃþ«¬

«ö¶s¨Ì¥~Æ[¦³³\¦hºØÃþ«¬¡A¤£¦PªºÃþ«¬¡A¥~Æ[»P¥\¯à¤]¤£¦P¡A³o³£¬O¦]¨ä­·®æ³y¦¨ªº¡C¤U¹Ïªºµøµ¡¬O¦b Windows 7 °õ¦æªºÀ³¥Îµ{¦¡²£¥Íªº¡A¨ä¤ºªº±±¨î¶µ³£¬O¤£¦P­·®æªº«ö¶s¡C

«öÀ£¶s¡]Push Buttons¡^

¥k¤U¹Ï¤¤³Ì¤U­±ªº¡u¨ú®ø¡v¬O¡u¤UÀ£¦¡«ö¶s¡v¡A¨ã¦³ BS_PUSHBUTTON ­·®æ¡A¬O³Ì±`¨Ï¥Îªº«ö¶s¡C¥¦¬O¥ßÅé¬ð¥Xªº¯x§Î¡A¤º¦³¤å¦r©Î¹Ï®×¡F·í¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»®É¡A¥i¥H°õ¦æ¬Y¨Ç¥\¯à¡C¦b¥¦¥kÃ䪺¬O¡u½T©w¡v«ö¶s¡A¥~Æ[»P¡u¨ú®ø¡v«ö¶sÃþ¦ü¡A¦ý¥~®Øªþªñ¥H°ª«G«×¤£¦P©ó¥|©PªºÃC¦âÅã¥Ü¡A³o¬O¡u¹w³]¤UÀ£¦¡«ö¶s¡v¡A¨ã¦³ BS_DEFPUSHBUTTON ­·®æ¡C¦pªG¥¦¦b¹ï¸Ü²°¤º¦Ó¨Ï¥ÎªÌ¤S«ö¤U Enter Áä®É¡A´N¬Û·í©ó¥H·Æ¹«¥ªÁäÂIÀ»¦¹«ö¶s¡F¦ý¦pªG¤£¦b¹ï¸Ü²°¤¤¡A´NµL¦¹®ÄªG¡C

¹Ï¤¤³Ì¤U­±ÁÙ¦³­Ó¡u½T©w¡v¬O¡u¥­­±«ö¶s¡v¡A¨ã¦³ BS_FLAT ­·®æªº«ö¶s¡A¦b¥ý«eªº Windows ¤¤¡A¥¦¥~Æ[²¼ä¡A¨S¦³¬ð¥XªºÃä®Ø©Î³±¼v®ÄªG¡A¬Ý°_¨Ó¤ñ¸û«ó¥­¡F¦ý¦b Windows 7 ¬Ý°_¨Ó»P¡u¤UÀ£¦¡«ö¶s¡v¤@¼Ë¡A¨S¤°»ò°Ï§O¡C

¦b¡uÂ÷¶}¡v«ö¶s¤W­±¦³­Ó¡u»¡©ú¡v«ö¶s¡A¦b¡u»¡©ú¡v¤å¦r«e¤è¦³­Ó½b¸¹¡A¡u»¡©ú¡v¤å¦r¤U¤è¦³´X¦æ¤p¦r¶i¤@¨BÄÄ©ú¦¹«ö¶s¥Î³~¡A³o¬O¨ã¦³ BS_COMMANDLINK ­·®æªº¡u«ü¥OÃì±µ«ö¶s¡v¡A¦b Windows Vista ¤Î¨ä«á­±ªºª©¥»¤~´£¨Ñªº¡C«Ø¥ß¡u«ü¥OÃì±µ«ö¶s¡v®É¡A²Ä¤@¦æªº¤j¦rºÙ¬°¥D¼ÐÃD¡A¨ä¾l¦æ³£¬O¤p¦rºÙ¬°°Æ¼ÐÃD¡A¥D¼ÐÃD»P°Æ¼ÐÃD»Ý²Õ¦X°_¨Ó¦¨¬°¤@­Ó¥H¹sµ²§Àªº¦r¦ê¡A¤¤¶¡¥H¡u\n¡v¤À¹j¥D¼ÐÃD»P°Æ¼ÐÃD¡A©I¥s CreateWindowEx ®É¦¹¦r¦ê¦ì§}¬°²Ä¤T­Ó°Ñ¼Æ¡C·í¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»¡u«ü¥OÃì±µ«ö¶s¡v®É¡Aµo¥X±a¦³ BN_CLICKED ªº WM_COMMAND °T®§¡C

¦b¡u»¡©ú¡v«ü¥OÃì±µ«ö¶s¤W¤è¦³¤@­Ó¡uµeµ§¼e«×¡v«ö¶s¡A¥¦¦³¤@±ø¤À³Î½u¤Î¦V¤U½bÀY¡C·í¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»¦V¤U½bÀY¡A·|¥X²{¥\¯àªí¨Ñ¨Ï¥ÎªÌ¿ï¾Ü¡C³oºØ«ö¶sºÙ¬°¡u¤U©Ô¦¡¤À³Î«ö¶s¡v¡A¨ã¦³ BS_SPLITBUTTON ­·®æ¡A¬O¦b Windows Vista ¤Î¨ä«á­±ªºª©¥»¤~´£¨Ñªº¡C¤ñ¸û¯S§Oªº¬O¡A¡u¤U©Ô¦¡¤À³Î«ö¶s¡v¤À¬°¥ª¡B¥k¨â³¡¤À¡A¨Ï¥ÎªÌÂIÀ»³o¨â³¡¤À²£¥Í¤£¦Pªº³qª¾½X¡C·í¨Ï¥ÎªÌÂIÀ»¥kÃ䪺¦V¤U½bÀY®É¡A·|§â WM_NOTIFY °T®§¶Çµ¹¤÷µøµ¡¡A¤÷µøµ¡¥²¶·¨Æ¥ý«Ø¥ß¦n¼u¥X¥\¯àªí¡AµM«á¦b³o®É©I¥s TrackPopupMenu Åã¥Ü¼u¥X¥\¯àªí¡C¨Ï¥ÎªÌ¦b¼u¥X¥\¯àªí¿ï©w¬Y­Ó¿ï¶µ®É¡A¤S·|¹ï¤÷µøµ¡µo¥X WM_COMMAND °T®§¡A¤÷µøµ¡¤~°µ¥X³B²z¡C³o«h WM_COMMAND ¨ä¹ê¬O¦]¬°¨Ï¥ÎªÌÂI¿ï¼u¥X¥\¯àªí¤¤ªº¿ï¶µ¦Óµo¥Xªº¡Cµù¤G¦³­Ó²²¤ªº¨Ò¤l¡C·í¨Ï¥ÎªÌÂIÀ»¥ªÃä¤å¦r®É¡Aµo¥X³qª¾½X¬° BN_CLICKED ªº WM_COMMAND °T®§¡C

¸s²Õ®Ø¡]Group Boxes¡^

¥k¤W¹Ï¤¤³Ì¤W­±¦³¨â­Ó¥Î¤ñ¥|©PÃC¦âµy·L²`ªº®Ø®Ø³ò¦í¡A¨ä¤@¦W¬°¡uÃC¦â¡v¡A¥t¤@­Ó¦W¬°¡u§A·Qµe¤°»ò¡H¡v¡A¦b¡uÃC¦â¡v®Ø®Ø¤U­±ªº¬O¡uÀ˵ø¡v¡A¤]¥Î¦P¼ËÃC¦â®Ø¦í¡A³o¤T­Ó³£¬O¡u¸s²Õ®Ø¡v¡A³£¨ã¦³ BS_GROUPBOX ­·®æ¡C¤@¯ë¦Ó¨¥¡A¥¦­Ì¬O§â¥\¯àÃþ¦ü©Î¬ÛÃöªº±±¨î¶µ³ò¦í¡AÅý¨Ï¥ÎªÌ·Pı³o¨Ç³ò¦íªº±±¨î¶µ¬O¦P¤@Ãþ¡C

³æ¿ï«ö¶s¡]Radio Buttons¡^

¦b¡uÃC¦â¡v¸s²Õ®Ø¤º¦³¥|­Ó¡u³æ¿ï«ö¶s¡v¡A¤À§O¬O¡u¶Â¦â¡v¡B¡u¬õ¦â¡v¡B¡uºñ¦â¡v¡B¡uÂŦâ¡v¡C¦b¥¦­Ì«e­±¦³­Ó°é°é¨Ñ¨Ï¥ÎªÌ°é¿ï¡A¦pªG¿ï¤¤ªº°é°é¤¤¶¡·|¦³¹ê¤ß¶ê¡C·í¨Ï¥ÎªÌ¿ï¾Ü¨Ï¥Î¬YºØÃC¦âµe¹Ï¡A´NµLªk¦P®É¥Î¥t¥~¤@ºØÃC¦âµe¹Ï¡F·íµM¦b³o¥H«á¡A¨Ï¥ÎªÌ¥i¯à¿ï¥Î¥t¥~¤@ºØÃC¦â¡A³o®É´NµLªk¥Î­ì¨ÓªºÃC¦âµe¹Ï¡C¤]´N¬O»¡¦P¤@®É¶¡¤º¡A¥u¯à¥Î¤@ºØÃC¦âµe¹Ï¡C¹³³oºØ¥u¯à¨Ï¥Î¨ä¤¤¤@ºØªº±¡§Î¡AºÙ¬°¡u¤¬¥¸¡vªº¡A©ÎªÌºÙ¬°³æ¿ïªº¡C³oÃþ«ö¶s¨ã¦³ BS_RADIOBUTTON ©Î BS_AUTORADIOBUTTON ­·®æ¡A¤À§OºÙ¬°¡u³æ¿ï«ö¶s¡v»P¡u¦Û°Ê³æ¿ï«ö¶s¡v¡C¥¦­Ìªº®t§O¦b©ó·í¨Ï¥ÎªÌ§ïÅÜ°é¿ï®É¡ABS_RADIOBUTTON ¥²¶·¦Û¦æ¼¶¼gµ{¦¡¡AÅý°é¿ï¤¤ªº¹ê¤ß¶ê¥u¦b¤@³BÅã¥Ü¦Ó¨ä¥LªÅ¥Õ¡A¦ý BS_AUTORADIOBUTTON «h¦Û°Ê§¹¦¨¡C

¦pªGÀ³¥Îµ{¦¡«Ø¥ßªº¨Ã«D¡u¦Û°Ê³æ¿ï«ö¶s¡v¡A¨º»ò¨Ï¥ÎªÌ¿ï¾Ü¨ä¤¤¤@­Ó¡A¦Ó­n±N¦¹«ö¶s«eªº°é°éµe¤W¹ê¤ß¶ê¡A¨ä¾lªÅ¥Õ¡A¥i¥H©I¥s CheckRadioButton §¹¦¨¡C

½Æ¿ï®Ø¡]Check Boxes¡^

¡uÀ˵ø¡v¤]¬O¤@­Ó¸s²Õ®Ø¡A¦ý¨ä¤ºªº¡uÅã¥ÜÃC¦â¡v¡B¡uÅã¥Ü©Òµe¹Ï§Î¡v¡B¡uÅã¥Üµeµ§¼e«×¡vµ¥¬O¥Î¨Ó¦bª¬ºA¦CÅã¥Ü¸ê°T¡C¥¦­Ì«e­±¦³¤è§Î®Ø®Ø¡A¥i¨Ñ¨Ï¥ÎªÌ¤Ä¿ï¡A¦pªG¿ï¤¤ªº·|¦b®Ø®Ø¤º¥´¤Ä¡A¤Ä¿ï¨ä¤¤¤@¶µ»P¬O§_¤Ä¿ï¨ä¥¦¶µ¨Ã¤£¬Û¤z¡C©Ò¥H¥i¥H¥þ¤£¿ï¡B¿ï¨ä¤¤¥ô¤@­Ó¡B©Î¥ô¨â­Ó¡B©Î¥þ¿ï¡A¬GºÙ¬°¡u½Æ¿ï®Ø¡v©Î¡u¦Û°Ê½Æ¿ï®Ø¡v¡C«eªÌ¨ã¦³ BS_CHECKBOX ­·®æ¡A«áªÌ¨ã¦³ BS_AUTOCHECKBOX ­·®æ¡C®t§O¬O¡A·í¨Ï¥ÎªÌ¿ï¤¤«á¡A«áªÌ¯à¦Û°Êµe¤Ä¤Ä¡A¦Ó«eªÌ»Ý­n¦Û¦æ¥Hµ{¦¡­×§ï¡C

¦b¡uÀ˵ø¡v¸s²Õ®Ø¤U¤è¦³¤@­Ó¡u¥þ³¡Åã¥Ü¡v«ö¶s¡A³o¬O¡u¤TºA«ö¶s¡v¡C¡u¤TºA«ö¶s¡v¬O¨ã¦³ BS_3STATE ­·®æªº«ö¶s¡A¬O¤@ºØ¯S®íªº½Æ¿ï®Ø¡A¤TºA¬O«ü¤Ä¿ï¡B¤£½T©w¡B¨S¤Ä¿ï¤TºØ±¡§Î¡A«e­±ªº¤è®Ø¤º¤À§O¥Î¤Ä¤Ä¡B¤è¶ô¡BªÅ¥Õªí¥Ü¡C¦ý¦pªG¨S¦³¾A·íµ{¦¡½X°t¦X¡AµL½×§A«ç»ò¥Î¤O¥H·Æ¹«¥ªÁäÂIÀ»¡A¤]³£²@µL®ÄªG¡C¥t¥~¤]¦³¡u¦Û°Ê¤TºA«ö¶s¡v¡A¬O¨ã¦³ BS_AUTO3STATE ­·®æªº«ö¶s¡A¤£¶·ÃB¥~µ{¦¡½X°t¦X¡A¨CÂIÀ»¤@¦¸¤è®Ø´N½ü¬y¦b¤Ä¤Ä¡B¤è¶ô¡BªÅ¥Õ¶¡¤Á´«¡C

¹ê»ÚÀ³¥Î¤W¡A¦b¦³³\¦h¶µ¥Ø­n¿ï¾Ü®É¡A¦pªG¥þ¿ï¡B¥þ¤£¿ï©Î¿ï¾Ü¨ä¤¤¤@¨Ç¦Ó¥t¤@¨Ç¤£¿ï®É¡A´N¥i¥H¥Î¡u¤TºA«ö¶s¡v¤è«K¹F¦¨¡C¨Ò¦p¤W¹ÏªºÀ˵ø¸s²Õ®Ø¡A¥i¥H¿ï¾Ü¬O§_Åã¥ÜÃC¦â¡B¬O§_Åã¥Üµe¥X¦óºØ¹Ï§Î¡B¬O§_Åã¥Üµeµ§¼e«×¡C¦pªG¤TªÌ³£­nÅã¥Ü¥i¥H«ö¡u¤TºA«ö¶s¡vª½¨ì¥X²{¤Ä¤Ä¡F¦pªG¤TªÌ³£¤£Åã¥Ü¥i¥H«ö¡u¤TºA«ö¶s¡vª½¨ì¥X²{ªÅ¥Õ¡F¦pªG¦³¨Ç­nÅã¥Ü¡B¦³¨Ç¤£Åã¥Ü¡A¥i¥H«ö¡u¤TºA«ö¶s¡vª½¨ìÅã²{¤è¶ô¡C¦p¤W¹Ï¤¤ªºÅã¥Ü¥þ³¡¤TºA«ö¶s¤¤ªº´N¬OÅã²{¤è¶ô¡A¦]¬°¥u¿ï¤F«e¨â¶µ¡AÅã¥ÜÃC¦â©MÅã¥Ü©Òµe¹Ï§Î¡A³Ì«á¤@¶µÅã¥Üµeµ§¼e«×«h¤£Åã¥Ü¡C

¾Ö¦³ªÌø»s«ö¶s¡]Owner-drawn Buttons¡^

«ö¶sªº­·®æ¤¤¤]¦³ BS_OWNERDRAW¡A¥ç§Y¡u¾Ö¦³ªÌø»s«ö¶s¡v¡A§¹¥þ¥Ñ¤÷µøµ¡¶i¦æø»s¡A¥²¶·¦b³B²z WM_DRAWITEM °T®§®É¶i¦æø»s¡C³o­ì²z¸ò²Ä¤Q¤K³¹¾Ö¦³ªÌø»sªº¿ï¶µÃþ¦ü¡AŪªÌ¥iÁ|¤@¤Ï¤T¸Õ¸Õ¬Ý¼¶¼g¡u¾Ö¦³ªÌø»s«ö¶s¡v¡C

¨ä¥L«ö¶s­·®æ

©³¤UÁÙ¦³¤@¨Ç­·®æ¡A¨Ã¤£¬O³y¦¨¤£¦PÃþ«¬ªº«ö¶s¡A¤]¤@¨Ö»¡©ú¡C

BS_LEFT¡BBS_CENTER¡BBS_RIGHT ¨Ï«ö¶sªº¤å¦r¦V¥ª¹ï»ô¡B¤ô¥­¸m¤¤¡B¦V¥k¹ï»ô¡A¹w³]­È¬O BS_CENTER¡F¦pªG¬O³æ¿ï«ö¶s©Î½Æ¿ï®Ø¡A¨ä¤¤ªº°é°é©Î®Ø®Ø¤´¦b³Ì¥ªÃä¡A³Ñ¾lªº«ö¶s½d³ò¤~µ¹¤å¦r¨Ï¥Î¡F¸s²Õ®Ø¤]·|¨ü¨ì BS_LEFT¡BBS_CENTER¡BBS_RIGHT ªº¼vÅT¡A¦ý¬O«ü¥OÃì±µ«ö¶s¨Ã¤£¨ü³o¤TºØ­·®æªº¼vÅT¡CBS_RIGHTBUTTON »P BS_LEFTTEXT ¥u¼vÅT³æ¿ï«ö¶s©Î½Æ¿ï®Ø¡A¨Ï¨ä¤å¦r¦b«ö¶s½d³òªº³Ì¥ªÃä¡A°é°é©Î®Ø®Ø¦b³Ì¥kÃä¡C

BS_TOP¡BBS_VCENTER¡BBS_BOTTOM ¨Ï«ö¶sªº¤å¦r¦V¤W¹ï»ô¡B¹]Áè¸m¤¤¡B¦V¤U¹ï»ô¡A¹w³]­È¬O BS_VCENTER¡C¸s²Õ®Ø»P«ü¥OÃì±µ«ö¶s¨Ã¤£·|¨ü¨ì³o¤TºØ­·®æªº¼vÅT¡C

BS_MULTILINE ¬O¦h¦æ«ö¶s¡A¦pªG¤å¦r¤Óªø¸IIJ¨ì«ö¶sÃä¬É¡A¥i¥H´«¦æ¡C©Ò¦³ªº«ö¶sÃþ«¬³£¨ü BS_MULTILINE ¼vÅT¡A«ü¥OÃì±µ«ö¶s­ì¥»´N¬O¦h¦æªº¡A¤£»Ý²K¥[ BS_MULTILINE ­·®æ¡C

¨Ï¥Î BS_ICON ©Î BS_BITMAP ­·®æªº«ö¶s¡A·|¦b«ö¶s¤WÅã¥Ü¹Ï¥Ü©Î¦ì¤¸¹Ï¡C¤èªk¬O¥ý¦b¸ê·½´y­zÀÉ©w¸q¹Ï¥Ü©Î¦ì¤¸¹Ï¡FµM«á©I¥s LoadIcon ©Î LoadBitmap ±o¨ì¹Ï¥Ü©Î¦ì¤¸¹Ï¥N½X¡F¦A¥H§t¦³ BS_ICON ©Î BS_BITMAP ­·®æ¬°°Ñ¼Æ©I¥s CreateWindowEx «Ø¥ß«ö¶s¡A±o¨ì«ö¶s¥N½X¡F³Ì«á¤@¨B©I¥s SendMessage §â BM_SETIMAGE °T®§¶Ç°eµ¹«ö¶s¡C

ÁÙ¦³¤@­Ó«ö¶s­·®æ BS_NOTIFY¡Aµy«á©ó¡u¦³Ãö«ö¶sªº³qª¾½X¡v»¡©ú¡C

«ö¶sªºª¬ºA

«ö¶s¦³¤TºØª¬ºA¡G①¬O§_¦³¿é¤JµJÂI¡B②¬O§_³B©ó«öÀ£¡B③¬O§_¿ï¨ú¡C

·í¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»«ö¶s¡B«ö Tab Áä©Î¤è¦VÁä«á«ö Enter Áä¡A¥i¥HÅý«ö¶sÀò±o¿é¤JµJÂI¡C¦ý¨Ã¤£¬O©Ò¦³Ãþ«¬ªº«ö¶s³£¯àÀò±o¿é¤JµJÂI¡A¥u¦³½Æ¿ï®Ø¡B³æ¿ï«ö¶s¡B«öÀ£¶s»P¾Ö¦³ªÌø»s«ö¶s¤~¯à±o¨ì¿é¤JµJÂI¡C¦P¤@­Ó®É¶¡¡A¥u¦³¤@­Ó±±¨î¶µ¨ã¦³¿é¤JµJÂI¡A·í¨Ï¥ÎªÌÂIÀ»¥t¤@­Ó±±¨î¶µ¡A¿é¤JµJÂI«KÂಾ¨ì·sÂIÀ»ªº±±¨î¶µ¤W¡A­ì¨Óªº±±¨î¶µ´N¥¢¥h¿é¤JµJÂI¡C·í«ö¶s¨ã¦³Áä½LµJÂI®É¡A³q±`·|¦³µê½u¥]³ò«ö¶sªº¤å¦r¡B¹Ï¥Ü©Î¦ì¤¸¹Ï¡A¦pªG¬O«öÀ£¶s«h·|¦³ÃC¦â¸û²`ªºÃä®Ø¡C

«öÀ£¶s¡B½Æ¿ï®Ø¡B³æ¿ï«ö¶s¨ã¦³«öÀ£ª¬ºA¡A¨ä¥L«ö¶sµL¦¹ª¬ºA¡C«ö¶sªº«öÀ£ª¬ºA¥i¥H¬O«ö¤U©Î¥¼«ö¤U¡C·í«ö¤U«öÀ£¶s®É¡A«öÀ£¶s·|Åܬ°¥W¤Uªº«ö¶s¡FÃP¶}®ÉÅܦ¨¥¼«ö¤Uª¬ºA¡AÅܦ¨¥Y°_ªº¡C·í½Æ¿ï®Ø¡B³æ¿ï«ö¶s³Q«ö¤U®É¡A­I´º·|ÅܦǡF¥¼«ö¤U®É¡A«ö¶sªº­I´º¤£·|ÅܦǡC

¥u¦³½Æ¿ï®Ø¡B³æ¿ï«ö¶s¤~¨ã¦³¿ï¨úª¬ºA¡C³Q¿ï¨úªº½Æ¿ï®Ø©Î³æ¿ï«ö¶s¡A¤À§O·|¦b«e­±ªº®Ø®Ø©Î¶ê°éÅã¥Ü¤Ä¤Ä©Î¹ê¤ß¶ê¡F¥¼³Q¿ï¨úªº«h¬OªÅ¥Õ¡C¤TºA«ö¶s¦h¤F¤@ºØª¬ºA¡A«e­±¤w¸g´£¹L¡C

¦³Ãö«ö¶sªº³qª¾½X

¨Ï¥ÎªÌ³Ì±`¹ï«ö¶s°µªº°Ê§@¬O¡A¥H·Æ¹«¥ªÁäÂIÀ»«ö¶s®É¡A³o®É·|µo¥X±a¦³ BN_CLICKED ³qª¾½Xªº WM_COMMAND °T®§µ¹¤÷µøµ¡¡A¦¹°T®§ªº wParam ²Ä 0¡ã15 ¦ì¤¸¬O«ö¶sÃѧO½X¡A16¡ã31 ¦ì¤¸´N¬O BN_CLICKED ³qª¾½X¡A¦Ó lParam ¬O«ö¶s¥N½X¡C¤÷µøµ¡ªºµøµ¡¨ç¦¡¥i¥H¨Ì¾Ú BN_CLICKED ¦Ó°µ¥X³B²z¡CµL½×¦óºØÃþ«¬ªº«ö¶s¡A³£·|µo¥X BN_CLICKED¡C

°£¤F¹ï«ö¶sÂIÀ»·|µo¥X³qª¾½X¤§¥~¡A¨ä¥L¹ï«ö¶sª¬ºAªº§ïÅܩΰʧ@¤]·|µo¥X³qª¾½X¡A³qª¾½X³£¦b WM_COMMAND °T®§ wParam ªº²Ä 16¡ã31 ¦ì¤¸¡A¨ä¾l³£¸ò BN_CLICK ¤@¼Ë¡A°£¤F BCN_HOTITEMCHANGE ¥H¥~¡C¤Uªí¬O«ö¶s·|²£¥Íªº³qª¾½X¥H¤Î»¡©ú¡G

³qª¾½X¼Æ­È»¡©ú
BN_CLICKED0¥H·Æ¹«ÂIÀ»«ö¶s
BN_DBLCLK5»P BN_DOUBLECLICKED ¦P¸q¡A¥H·Æ¹«ÂùÀ»«ö¶s
BN_DISABLE4«ö¶s³Q¸T¥Î
BN_PUSHED2»P BN_HILITE ¦P¸q¡AÀ£«ö«ö¶s
BN_UNPUSHED3»P BN_UNHILITE ¦P¸q¡AÃP¶}«ö¶s
BN_KILLFOCUS7«ö¶s¥¢¥h¤FÁä½LµJÂI
BN_SETFOCUS6«ö¶sÀò±o¤FÁä½LµJÂI
BN_PAINT1À³Ã¸»s«ö¶s«e
BCN_HOTITEMCHANGE-1249·Æ¹«´å¼Ð²¾¶i©ÎÂ÷¶}«ö¶s

¨Ï¥ÎªÌ¥H·Æ¹«¥ªÁäÂIÀ»«ö¶s¡A¬Ý¦ü«Ü³æ¯Âªº°Ê§@¡A¨Æ¹ê¤W«ö¶sª¬ºA´N¦³¼Æ¦¸ÅܤơC­º¥ý¡A·Æ¹«ÂI¨ì«ö¶s®É¡A«ö¶s·|±o¨ì¿é¤JµJÂI¡A¦P®ÉÅܦ¨«ö¤Uª¬ºA¡Cª`·N¡IÂIÀ»ªº°Ê§@¥]§tÀ£¤U¡A±µµÛÃP¶}¡A©Ò¥H¨Ï¥ÎªÌÃP¶}¥ªÁä®É¡A«ö¶s¤SÅܦ¨¥¼«ö¤Uª¬ºA¡C¤j³¡¤Àªº®É­Ô¡AÀ³¥Îµ{¦¡¨Ã¤£¦b·N³o¨Ç²Ó¸`¡A¥u¦b·NÂIÀ»ªº¾ãÅé°Ê§@¡A¦]¦¹¤j³¡¤À®É­Ô Windows ¨Ã¤£»Ý­n§â«ö¶sªº©Ò¦³°Ê§@³£³qª¾µ¹¤÷µøµ¡¡A°£¤F BN_CLICKED ¥H¥~¡C

¦pªG¯uªº»Ý­n®É¡A¥i¥H¨Ï«ö¶s¥[¤W BS_NOTIFY ­·®æ¡A³o¼Ëªº«ö¶s´N¯àµo¥X BN_DISABLE¡BBN_PUSHED¡BBN_UNPUSHED¡BBN_KILLFOCUS¡BBN_SETFOCUS ©M BN_PAINT ³qª¾½X¡C¹ï©ó BN_DBLCLK ³qª¾½X¡AWindows ªº³B¸m¬O¡A¥u¦³³æ¿ï«ö¶s¤Î¾Ö¦³ªÌø»s«ö¶s¯à¥D°Êµo¥X BN_DBLCLK ³qª¾½X¡A¨ä¾lÃþ«¬ªº«ö¶s³£¥²¶·­n¨ã¦³ BS_NOTIFY ­·®æ¡A¤~·|µo¥X BN_DBLCLK ³qª¾½X¡C

BCN_HOTITEMCHANGE ¬O¦b Windows XP ¤Î¨ä¥H«áªº¨t²Î¤~¦³ªº³qª¾½X¡CBCN_HOTITEMCHANGE ¨Ã¤£¬O¦ì©ó WM_COMMAND °T®§ wParam ªº²Ä 16¡ã31 ¦ì¤¸¡A³oÂI»P¨ä¥L³qª¾½X¤£¦P¡CBCN_HOTITEMCHANGE ¬Oªþ¦b WM_NOTIFY °T®§¤¤¡A¦¹°T®§¦³ÂI½ÆÂø¡A¥H«á¦A»¡¡C

¦³Ãö«ö¶sªº°T®§

¤÷µøµ¡¯à°÷©I¥s SendMessage §â°T®§¶Çµ¹«ö¶s¡AÂÇ¥HÀò±o¸ê®Æ©Î¾Þ§@«ö¶s¡C©³¤U¬O¯àÂÇ¥Ñ SendMessage ¶Ç°eµ¹«ö¶sªº°T®§¡G

°T®§»¡©ú wParamlParam¦^¶Ç­È
BM_GETCHECKÀò±o³æ¿ï«ö¶s©Î½Æ¿ï®Ø¬O§_³Q¿ï¨ú¤£¨Ï¥Î¡AÀ³³]¬° 0¤£¨Ï¥Î¡AÀ³³]¬° 0¦^¶Ç­È¬O¤U­±¤TºØ¨ä¤¤¤§¤@¡G
BST_CHECKED¡G¿ï¨ú
BST_INDETERMINATE¡G¤£½T©w
BST_UNCHECKED¡G¥¼¿ï¨ú
BM_SETCHECK³]©w³æ¿ï«ö¶s©Î½Æ¿ï®Ø¬O§_³Q¿ï¨ú­n³]©wªº¿ï¨úª¬ºA¡A¦³¤TºØ±¡§Î¡G
BST_CHECKED¡G¿ï¨ú
BST_INDETERMINATE¡G¤£½T©w
BST_UNCHECKED¡G¥¼¿ï¨ú
¤£¨Ï¥Î¡AÀ³³]¬° 00
BM_GETSTATEÀò±o«ö¶sª¬ºA¤£¨Ï¥Î¡AÀ³³]¬° 0¤£¨Ï¥Î¡AÀ³³]¬° 0 ¦^¶Ç­È¦³¤U­±´XºØ±¡§Î¡G
BST_CHECKED¡G¤w¿ï¨ú
BST_DROPDOWNPUSHED¡G³B©ó¤U©Ôª¬ºA¡A¶È¤U
¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@©Ô¦¡¤À³Î«ö¶s¤~¾A¥Î
BST_FOCUS¡G«ö¶s¨ã¦³¿é¤JµJÂI
BST_HOT¡G«ö¶s³B©ó§@¥Î¤¤ª¬ºA¡A¤]´N¬O»¡¡A·Æ
¡@¡@¡@¡@¡@ ¹«°±¯d¦b¤W¤è
BST_INDETERMINATE¡G«ö¶s³B©ó¿ï¨ú¤£½T©wª¬
¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@ºA¡A¶È¥Î©ó¤TºA«ö¶s
BST_PUSHED¡G«ö¶s³B©ó³QÀ£¤Uª¬ºA
BST_UNCHECKED¡G¨S¦³¯S®íª¬ºA¡A¬Û·í©ó¹s
BM_SETSTATE§ïÅÜ«ö¶sªº«öÀ£ª¬ºA­Y¬° 1¡Aªí¥ÜÀ£¤U«ö¶s
­Y¬° 0¡Aªí¥ÜÃP¶}«ö¶s
¤£¨Ï¥Î¡AÀ³³]¬° 0µL
BM_SETSTYLE§ïÅÜ«ö¶s­·®æ·sªº­·®æ­Y¬° 1¡A­«·sø»s«ö¶s
­Y¬° 0¡A¤£­«·sø»s
µL
BM_SETIMAGE³]©w«ö¶sªº¹Ï¥Ü©Î¦ì¤¸¹Ï¥i¥H¬O IMAGE_BITMAP ©Î IMAGE_ICON¨Ì¾Ú wParam¡AlParam ¬°¦ì¤¸¹Ï¥N½X©Î¹Ï¥Ü¥N½X­ì¥ýªº¦ì¤¸¹Ï¥N½X©Î¹Ï¥Ü¥N½X¡A­Y­ì¨Ó©|¥¼³]©w«h¦^¶Ç­È¬° 0¡]°Ñ¦Òµù¤@¡^
BM_GETIMAGE¨ú±o«ö¶sªº¦ì¤¸¹Ï©Î¹Ï¥Ü¥N½X¥i¥H¬O IMAGE_BITMAP ©Î IMAGE_ICON¤£¨Ï¥Î¡AÀ³³]¬° 0¨Ì¾Ú wParam¡A¦^¶Ç­È¬°¦ì¤¸¹Ï©Î¹Ï¥Ü¥N½X
BM_CLICK¼ÒÀÀ¨Ï¥ÎªÌÂIÀ»«ö¶s¤£¨Ï¥Î¡AÀ³³]¬° 0¤£¨Ï¥Î¡AÀ³³]¬° 0µL

BM_CLICK ·|¨Ï«ö¶s±µ¦¬ WM_LBUTTONDOWN ©M WM_LBUTTONUP °T®§¡A¨Ã¥B«ö¶sªº¤÷µøµ¡±µ¦¬±a¦³ BN_CLICKED ³qª¾½Xªº WM_COMMAND °T®§¡C


¨Ò¤l¡GLY.ASM

³o­Ó¨Ò¤l¬O¦b¤@µøµ¡¤º¡A«Ø¥ß¤TºØÃþ§O¤­­Ó±±¨î¶µ¡A¨ä¤¤¨â­Ó¬OÀRºA±±¶µ¡B¤@­Ó½s¿è®Ø¥H¤Î¨â­Ó«ö¶s¡C°õ¦æ®Éµe­±¦p¥k¡A¨Ï¥ÎªÌ²Ä¤@¦¸¥H·Æ¹«¥ªÁäÂIÀ»½s¿è®Ø®É¡A·|¥X²{¥u¯à¿é¤Jªü©Ô§B¼Æ¦rªº´£¥Ü¹ï¸Ü²°¡A«ö¡u½T©w¡v«ö¶sÂ÷¶}´£¥Ü¹ï¸Ü²°¡A¥H«á´N¤£¦A¥X²{¤F¡Cµ¥¨Ï¥ÎªÌ¿é¤J¦n¦è¤¸¦~¥÷¤§«á¡A¦A«ö¡u¬d¸ß¡v«ö¶s¡A¤U­±ªºÀRºA±±¨î¶µ·|Åã¥Ü¸Ó¦~¬°¶|¦~ÁÙ¬O¥­¦~¡C¨Ï¥ÎªÌ¤]¥i¥H¥Î·Æ¹«¥ªÁäÂIÀ»¤W­±ªºÀRºA±±¨î¶µ¡A·|¥X²{«ç»ò¥Ñ¦è¤¸¦~¥÷­pºâ¥X¶|¦~ªº¹ï¸Ü²°¡C«ö¡uÂ÷¶}¡v«ö¶s°h¥Xµ{¦¡¡CLY.ASM ­ì©l½X¥i¦b³oùؤU¸ü¡C

©³¤U»¡©ú LY.ASM ªºµ{¦¡½X¡C

¥Dµ{¦¡µù¥Uµøµ¡Ãþ§O¡B«Ø¥ßµøµ¡¡BÅã¥Üµøµ¡¡AµM«á«Ø¥ß°T®§°j°é¡C³o¨Ç³£¬O¤@¯ë¹Lµ{¡A¬Ù²¤¤£»¡¡Aª½±µ¶i¤Jµøµ¡¨ç¦¡¡C

«Ø¥ß¤­­Ó±±¨î¶µ

«Ø¥ß¤­­Ó±±¨î¶µªºµ{¦¡½X¡AÀ³©ñ¦bµøµ¡¨ç¦¡¡A³B²z WM_CREATE °T®§¤¤¡Cµ{¦¡½X¦p¤U¡G

.CONST
szClassStatic   DB      "STATIC",0      ;ÀRºA±±¨î¶µÃþ§O¦WºÙ
szClassEdit     DB      "EDIT",0        ;½s¿è®ØÃþ§O¦WºÙ
szClassButton   DB      "BUTTON",0      ;«ö¶sÃþ§O¦WºÙ
szAskYear       DB      "¿é¤J¦è¤¸¦~¥÷¡G",0
szInput         DB      "½Ð¿é¤J¦è¤¸¦~¥÷¡C",0
szInquire       DB      "¬d¸ß",0
szExit          DB      "Â÷¶}",0
  ⁝
  .case WM_CREATE
    ;«Ø¥ß¤TºØÃþ§O¤­­Ó±±¨î¶µ
        ;«Ø¥ß¡u¿é¤J¦è¤¸¦~¥÷¡G¡vÀRºA±±¨î¶µ¡A³oÀRºA±±¨î¶µ¨ã¦³ SS_NOTIFY ­·®æ
        invoke  CreateWindowEx,0,OFFSET szClassStatic,OFFSET szAskYear,\
                WS_CHILD or WS_VISIBLE or SS_NOTIFY,\
                16,10,108,28,hWnd,IDS_ASK,hInstance,0
        mov     hStaAsk,rax
        ;«Ø¥ß¨ã¦³ ES_NUMBER ­·®æªº½s¿è®Ø
        invoke  CreateWindowEx,WS_EX_CLIENTEDGE,OFFSET szClassEdit,0,\
                WS_CHILD or WS_VISIBLE or WS_BORDER or ES_LEFT or ES_NUMBER,\
                126,6,80,28,hWnd,IDE_YEAR,hInstance,0
        mov     hEdit,rax
        ;«Ø¥ß¡u½Ð¿é¤J¦è¤¸¦~¥÷¡C¡vÀRºA±±¨î¶µ
        invoke  CreateWindowEx,0,OFFSET szClassStatic,OFFSET szInput,\
                WS_CHILD or WS_VISIBLE,\
                16,48,145,28,hWnd,IDS_RESULT,hInstance,0
        mov     hStaRes,rax
        ;«Ø¥ß¡u¬d¸ß¡v¹w³]¤UÀ£¦¡«ö¶s
        invoke  CreateWindowEx,0,OFFSET szClassButton,OFFSET szInquire,\
                WS_CHILD or WS_VISIBLE or BS_DEFPUSHBUTTON,\
                36,82,52,28,hWnd,IDS_INQUIRE,hInstance,0
        mov     hBtnInquire,rax
        ;«Ø¥ß¡uÂ÷¶}¡v¤UÀ£¦¡«ö¶s
        invoke  CreateWindowEx,0,OFFSET szClassButton,OFFSET szExit,\
                WS_CHILD or WS_VISIBLE or BS_PUSHBUTTON,\
                128,82,52,28,hWnd,IDB_EXIT,hInstance,0
        mov     hBtnExit,rax
    ;³]©w½s¿è®Ø³Ì¤j¿é¤Jªø«×¬°4­Ó¦r¤¸
        invoke  SendMessage,hEdit,EM_SETLIMITTEXT,4,0

«Ø¥ß³o¨Ç±±¨î¶µ¡A³£¬O©I¥s CreateWindowEx¡A®t§O¦b©óµøµ¡Ãþ§O¡Bµøµ¡ªº¤å¦r¡B­·®æ¡B¦ì¸m¡B¤j¤p¡BÃѧO½X¡C©³¤U»¡©ú­«ÂI¡G

  1. ¨C­Ó±±¨î¶µªº­·®æ³£¥]§t¡uWS_CHILD or WS_VISIBLE¡v¡C±±¨î¶µ³£¬O¤lµøµ¡¡A©Ò¥H¥[¤W WS_CHILD ¬O²z©Ò·íµM¡C¦pªG¨S¦³ WS_VISIBLE¡A¤£·|Åã¥Ü±±¨î¶µ¡A±o¦Û¦æ©I¥s ShowWindow¡C
  2. ¡u¿é¤J¦è¤¸¦~¥÷¡G¡vÀRºA±±¨î¶µ¨ã¦³ SS_NOTIFY ­·®æ¡A¦]¦¹¥¦¯àµo¥X WM_COMMAND¡ALY.ASM ¥Î¦¹°T®§Åý¨Ï¥ÎªÌÂIÀ»¥¦®É¡A¥X²{«ç»ò¥Ñ¦è¤¸¦~¥÷­pºâ¥X¶|¦~ªº¹ï¸Ü²°¡C
  3. ½s¿è®Ø°£¤F¡uWS_CHILD or WS_VISIBLE¡v¤§¥~ÁÙ¥]§t WS_BORDER¡BES_NUMBER ­·®æ¡C¦pªG¨S¦³ WS_BORDER¡A¨º»ò½s¿è®Ø´N¨S¦³¥~®Ø¡A·|Åý¨Ï¥ÎªÌ¤À¿ë¤£¥X¨Ó½s¿è®Ø¦b­þ¨à¡C¦]¬° LY.ASM ­nÅý¨Ï¥ÎªÌ¿é¤Jªº¬O¦è¤¸¦~¥÷¡A³£¬Oªü©Ô§B¼Æ¦r¡A©Ò¥H³]©w ES_NUMBER ­·®æ¡AÅý¨Ï¥ÎªÌ¥u¯à¿é¤Jªü©Ô§B¼Æ¦r¡C°²¦p­nÅý½s¿è®Ø¤º¦³¹w³]ªº¦r¦ê¡A¥i¥H±N²Ä¤T­Ó°Ñ¼Æ¥Ñ 0 §ï¦¨¹w³]ªº¦r¦ê¦ì§}¡C
  4. ½s¿è®Ø¥²¶·­n³]©w WS_BORDER¡A¤~¦³¥~®Ø¡A¨º»òÀRºA±±¨î¶µ©M«ö¶s©O¡HÀRºA±±¨î¶µ¤]­n¨ã¦³ WS_BORDER ­·®æ¡A¤~¦³¥~®Ø¡A¦ý¬OÀRºA±±¨î¶µ¥u¬O¤@¦ê¤å¦r¡A¤@¯ë¤£¨ã¦¹­·®æ¤]¤£·|³y¦¨¤£«K¡C«ö¶s«h¬O¦]¬°µøµ¡Ãþ§O´N¤w¸g¹w³]¦³¥~®Ø¡A©Ò¥H¤£¥²¯S§O³]©w¡C
  5. ¨C­Ó±±¨î¶µªº¦ì¸m»P¤Ø¤o³£¬O¤@¤@¹Á¸Õ¿ù»~ªºµ²ªG¡A¤U¤@³¹¦A»¡©ú¨ä¥L¸û¦nªº¤èªk¡C
  6. SendMessage ¥i¥H§â°T®§¶Çµ¹±±¨î¶µ¡A§ïÅܱ±¨î¶µªºÄÝ©Ê¡C¨Ò¦p¤W­±µ{¦¡ªº³Ì«á¤@¦æ¡A§â EM_SETLIMITTEXT °T®§¶Çµ¹½s¿è®Ø¡A´N¯à­­¨î½s¿è®Ø³Ì¦h¿é¤J´X­Ó¦r¤¸¡C

§âµøµ¡©ñ¦b¿Ã¹õ¥¿¤¤¥¡

­n§âµøµ¡©ñ¦b¿Ã¹õ¥¿¤¤¥¡¡A»Ý­n¤U­±ªº¨âµ§¸ê®Æ¡G①µøµ¡¼e«×»P°ª«×¡B②¿Ã¹õ¼e«×»P°ª«×¡C«eªÌ¥i¥H©I¥s GetWindowRect ±o¨ì¡A«áªÌ¥i¥H©I¥s GetSystemMetrics ±o¨ì¡C

©I¥s GetWindowRect ¦¨¥\«á¡A²Ä¤G­Ó°Ñ¼Æ¬O·í«eµøµ¡¦û¦³¯x§Îªº¥ª¤W¨¤¤Î¥k¤U¨¤®y¼Ð¡A±N¨ä¬Û´î´N¬Oµøµ¡ªº¼e«×»P°ª«×¡C¥H SM_CXSCREEN ¬°°Ñ¼Æ©I¥s GetSystemMetrics¡A´N±o¨ì¿Ã¹õ¼e«×¡A¥H SM_CYSCREEN ¬°°Ñ¼Æ©I¥s GetSystemMetrics¡A´N±o¨ì¿Ã¹õ°ª«×¡C

¦³¤F³o¨Ç¸ê®Æ¤§«á¡A§â¿Ã¹õ¼e«×¥ý´î¥hµøµ¡¼e«×¡A©Ò±o¤§®t¦A°£¥H¤G¡A´N¬Oµøµ¡·s¦ì¸mªº X ®y¼Ð¡C¦P²z¡A§â¿Ã¹õ°ª«×´î¥hµøµ¡°ª«×¡A©Ò±o¤§®t¦A°£¥H¤G¡A´N¬Oµøµ¡·s¦ì¸mªº Y ®y¼Ð¡C³Ì«á©I¥s SetWindowPos ´N¯à±Nµøµ¡²¾¨ì¿Ã¹õ¥¿¤¤¥¡¤F¡C¥u»Ý§âµøµ¡²¾¨ì·sªº X¡BY ®y¼Ð¡A¤£½Õ¾ãµøµ¡¤j¤p¤]¤£½Õ¾ã Z ¶b¶¶§Ç¡A©Ò¥H³Ì«á¤@­Ó°Ñ¼Æ¬O¡uSWP_NOZORDER or SWP_NOSIZE¡v¡Aµ{¦¡½X¦p¤U¡G

        invoke  SetWindowPos,hWnd,0,r8d,r9d,0,0,SWP_NOZORDER or SWP_NOSIZE

³B²z WM_COMMAND °T®§

LY »P¨Ï¥ÎªÌ¤¬°Êªº¥D­n¹Lµ{³£¦b³B²z WM_COMMAND °T®§¤¤µo¥Í¡C¦b LY ¤¤­n³B²zªº³qª¾½X¦³¡G①¨Ï¥ÎªÌ«ö¤U¨â­Ó«ö¶s¤¤ªº¥ô¦ó¤@­Ó¥Í¦¨ªº³qª¾½X¡ABN_CLICKED¡C②¨Ï¥ÎªÌÂIÀ»¡u¿é¤J¦è¤¸¦~¥÷¡G¡vÀRºA±±¨î¶µªº³qª¾½X¡ASTN_CLICKED¡C③¨Ï¥ÎªÌÂIÀ»½s¿è®Ø®É¡A½s¿è®ØÀò±o¿é¤JµJÂI¡A³qª¾½X¬O EN_SETFOCUS¡C

²Ä①±¡ªp¡A¨Ï¥ÎªÌ«ö¡u¬d¸ß¡v©Î¡uÂ÷¶}¡v«ö¶s³£·|²£¥Í BN_CLICKED¡A©Ò¥H¥²¶·¦A¶i¤@¨B°Ï¤À¨Ï¥ÎªÌ¨ì©³¬O«ö¤U­þ¤@­Ó«ö¶s¡C³o®É¥i¥H¥ÎÃѧO½X¨Ó¤À¿ë¡A¤]¥i¥H¥Î«ö¯Ã¥N½X¨Ó¤À¿ë¡C«ö¤U¡u¬d¸ß¡v«ö¶s«á¡ALY ­n­pºâ½s¿è®Ø¤ºªº¦è¤¸¦~¥÷¬O§_¬°¶|¦~¡A«ö¤U¡uÂ÷¶}¡v«ö¶s«h°h¥X LY µ{¦¡¡C

²Ä②±¡ªp¡A¨Ï¥ÎªÌÂIÀ»¨ã¦³ SS_NOTIFY ­·®æªº¡u¿é¤J¦è¤¸¦~¥÷¡G¡vÀRºA±±¨î¶µ®É¡A·|µo¥X STN_CLICKED ªº WM_COMMAND °T®§¡C³B²z¦¹³qª¾½Xªº¤è¦¡¬O©I¥s MessageBox¡A¼u¥X¤@µøµ¡¡A§iª¾¨Ï¥ÎªÌ¦p¦ó¥Ñ¦è¤¸¦~¥÷±o¥X¸Ó¦~¬O§_¬°¶|¦~¡C­nª`·Nªº¬O¡ASTN_CLICKED »P BN_CLICKED ªº¼Æ­È³£¬O 0¡A¦]¦¹¥²¶·©M«ö¶sªº BN_CLICKED ¦b¦P¤@­Ó¡u.if/.elseif/.endif¡v°Ï¶ô¤º¡Aµ{¦¡½X¦p¤U¡G

  .case WM_COMMAND
        mov     rax,r8  ;R8W¡×ÃѧO½X
        shr     rax,16  ;AX¡×³qª¾½X
    .if ax==BN_CLICKED
      .if r9==hBtnExit  ;R9¡×±±¨î¶µ¥N½X
        jmp     quit
      .elseif r9==hBtnInquire
          ⁝              ;­pºâ½s¿è®Ø¤ºªº¦è¤¸¦~¥÷¬O§_¬°¶|¦~
      .elseif r9==hStaAsk
          ⁝              ;©I¥s MessageBox¡A¼u¥X¹ï¸Ü²°»¡©ú¦p¦ó¥Ñ¦è¤¸¦~¥÷±o¥X¸Ó¦~¬O§_¬°¶|¦~
      .endif
    .elseif ax==EN_SETFOCUS
          ⁝              ;©I¥s MessageBox¡A¼u¥X¹ï¸Ü²°§iª¾¥u¯à¿é¤Jªü©Ô§B¼Æ¦r
    .endif

¤£¯à¼g¦¨¤U­±ªº¼Ë¤l¡A§_«hµL½×¨Ï¥ÎªÌ«ç¼Ë«ö¡u¿é¤J¦è¤¸¦~¥÷¡G¡vÀRºA±±¨î¶µ¡A¥Ã»·¤]¤£·|¼u¥X¹ï¸Ü²°§iª¾¦p¦ó¥Ñ¦è¤¸¦~¥÷±o¥X¸Ó¦~¬O§_¬°¶|¦~¡C

  .case WM_COMMAND
        mov     rax,r8  ;R8W¡×ÃѧO½X
        shr     rax,16  ;AX¡×³qª¾½X
    .if ax==BN_CLICKED
      .if r9==hBtnExit  ;R9¡×±±¨î¶µ¥N½X
        jmp     quit
      .elseif r9==hBtnInquire
          ⁝              ;­pºâ½s¿è®Ø¤ºªº¦è¤¸¦~¥÷¬O§_¬°¶|¦~
      .endif
    .elseif ax==STN_CLICKED
      .if r9==hStaAsk
          ⁝              ;©I¥s MessageBox¡A¼u¥X¹ï¸Ü²°§iª¾¦p¦ó¥Ñ¦è¤¸¦~¥÷±o¥X¸Ó¦~¬O§_¬°¶|¦~
      .endif
    .elseif ax==EN_SETFOCUS
          ⁝              ;©I¥s MessageBox¡A¼u¥X¹ï¸Ü²°§iª¾¥u¯à¿é¤Jªü©Ô§B¼Æ¦r
    .endif

¨Ï¥ÎªÌÂIÀ»½s¿è®Ø®É¡A½s¿è®ØÀò±o¿é¤JµJÂI¡A²£¥Í³qª¾½X¬O EN_SETFOCUS ªº WM_COMMAND °T®§¡CLY ¦b³o®É­Ô¼u¥X¤@­Ó¹ï¸Ü²°¡A´£¿ô¨Ï¥ÎªÌ¡A¦¹½s¿è®Ø¶È¯à¿é¤Jªü©Ô§B¼Æ¦r¡C¦]¬°¼u¥X¹ï¸Ü²°¡A©Ò¥H½s¿è®Ø·|¥¢¥h¿é¤JµJÂI¡A¦pªG­n¿é¤J¦è¤¸¦~¥÷¡A¤S­n¦AÂIÀ»½s¿è®Ø¤@¦¸¡A½s¿è®Ø¤S·|±o¨ì¿é¤JµJÂI¡C­Y¦¹®É¤S¼u¥X´£¿ô¨Ï¥ÎªÌ¥u¯à¿é¤Jªü©Ô§B¼Æ¦rªº¹ï¸Ü²°¡A¨º»ò¨Ï¥ÎªÌ¥Ã»·¤]§O·Q¿é¤J¦è¤¸¦~¥÷¤F¡CLY ªº¸Ñ¨M¤èªk¬O©w¸q¤@­Ó first ºX¼Ð¡A­ì¥ý¦¹ºX¼Ð¬° 1¡A·í½s¿è®Ø²Ä¤@¦¸±o¨ì¿é¤JµJÂI®É¡A±N¨ä³]¬°¹s¡C³o¼Ë¥u­nÀˬd first ¬O§_¬°¤@¡A¥u¦³ first ¬°¤@®É¡Aªí¥Ü½s¿è®Ø±q¥¼±o¨ì¿é¤JµJÂI¹L¡A¤~¼u¥X¹ï¸Ü²°¡F§_«h©¿²¤¦¹³qª¾½X¡C

¥Ñ¦è¤¸¦~¥÷­pºâ¸Ó¦~¬O§_¬°¶|¦~

¥Ñ¦è¤¸¦~¤À­pºâ¸Ó¦~¬O§_¶|¦~ªº¨BÆJ¦p¤U¡G

  1. ¦pªG¦è¤¸¦~¥÷¯à³Q 400 ¾ã°£¡A¸Ó¦~¬°¶|¦~¡C¨Ò¦p¦è¤¸ 2000 ¦~¬O¶|¦~¡C
  2. ¦pªG¦è¤¸¦~¥÷¯à³Q 100 ¾ã°£¥B¤£¯à³Q400¾ã°£ªº¬O¥­¦~¡C¨Ò¦p¦è¤¸ 1800 ¦~¡B¦è¤¸ 1900 ¦~³£¬O¥­¦~¡C
  3. ¨ä¾lªº¦è¤¸¦~¥÷¯à³Q 4 ¾ã°£ªº¬O¶|¦~¡C¨Ò¦p¦è¤¸ 2020 ¦~¡B¦è¤¸ 2024 ¦~³£¬O¶|¦~¡C

¹ï©ó«e¨â¶µ³W«h¡A¤p¤ì°¸¥u¯à¦Ñ¦Ñ¹ê¹ê¦a¶i¦æ°£ªk¹Bºâ¡AÀˬd¾l¼Æ¬O§_¬°¹s¡A¨S¦³¨ä¥L¦nªº¤èªk¡F¦pªG¦³°ª¤H¯à¥[¥H«üÂI¡A·P¿E¤£ºÉ¡C¹ï©ó²Ä¤T¶µ¡A­Ë¬O¦³¤@­Ó«Ü²³æªº¤èªk´N¯àÀˬd¬O§_¯à³Q¥|¾ã°£¡CÅý­nÀˬdªº¦è¤¸¦~¥÷»P 3 ¶i¦æ AND ¹Bºâ¡A¦pªGµ²ªG¬°¹sªí¥Ü¯à³Q¥|¾ã°£¡Fµ²ªG¤£¬°¹sªí¥Ü¤£¯à³Q¥|¾ã°£¡C¦pªG­n¨Ï¦è¤¸¦~¥÷¦b¹Bºâ¹Lµ{¤£ÅÜ¡A¨º»ò¤]¥i¥H§â AND ¹Bºâ§ï¦¨ TEST ¹Bºâ¡C

«e­±´£¹L¡A¹ï¤G¶i¦ì¼Æ¦Ó¨¥¡A©¹¥ª²¾¤@¦ì¬Û·í©ó­¼¥H¤G¡A­ì¨Ó³Ì¥kÃ䪺 0 ©Î 1 ¥ª²¾¤F¡A·sªº³Ì¥kÃä¶ñ¤W 0¡F©¹¥ª²¾¨â¦ì¬Û·í©ó­¼¥H¥|¡A³Ì¥kÃä¨â¦ì³£·|Åܦ¨¹s¡C¬JµM¦V¥ª²¾¤F¨â¦ì¬Û·í©ó­¼¥H¥|¡A¦¹¼Æ´N¬O¦üªº­¿¼Æ¡A¯à³Q¥|¾ã°£¡Cºî¦X¤W­zµ²ªG¡A¤@­Ó¼Æ¦pªG¬O¥|ªº­¿¼Æ¡A¥¦ªº²Ä¹s¦ì¤¸©M²Ä¤@¦ì¤¸³£¬O¹s¡C³o¤]´N¬O¤@­Ó¼Æ»P 3 ¶i¦æ AND ¹Bºâ¡A¦pªGµ²ªG¬°¹s¡Aªí¥Ü¦¹¼Æ¯à³Q¥|¾ã°£¡C©³¤U¬O³o¬q¹Lµ{ªºµ{¦¡½X¡G

szLeapYear      DB      "¦è¤¸%d¦~¬O¶|¦~¡C",0
szCommonYear    DB      "¦è¤¸%d¦~¬O¥­¦~¡C",0
        ⁝
        invoke  GetWindowText,hEdit,ADDR buffer,5
        invoke  StrToInt,ADDR buffer
        lea     r10,szLeapYear
        mov     r11,400
        mov     r8,rax  ;RAX¡×¦è¤¸¦~¥÷
        xor     rdx,rdx
        div     r11
        or      rdx,rdx ;¯à³Q400¾ã°£ªº¬O¶|¦~
        jz      @f
        mov     rax,r8
        mov     r11,100 ;¯à³Q100¾ã°£¥B¤£¯à³Q400¾ã°£ªº¬O¥­¦~
        xor     rdx,rdx
        div     r11
        or      rdx,rdx
        jz      comyr
        test    r8,3    ;¨ä¾l¯à³Q4¾ã°£ªº¬O¶|¦~
        jz      @f
comyr:  lea     r10,szCommonYear
@@:     invoke  wsprintf,ADDR buffer,r10,r8d
        lea     rdx,buffer
blank:  invoke  SetWindowText,hStaRes,rdx

µù¤@

¥»³¹©Ò¥Î¨ìªº Win64 API¡G

EnableWindow API

EnanleWindow ¥i¥H§âµøµ¡©Î±±¨î¶µ³]¬°±Ò¥Î¡]enable¡^©Î¸T¥Î¡]disable¡^ª¬ºA¡C±Ò¥Î®É¡Aµøµ¡©Î±±¨î¶µ¥i¥H±µ¦¬Áä½L¥H¤Î·Æ¹«ªº¿é¤J¡F¸T¥Î®É¡Aµøµ¡©Î±±¨î¶µµLªk±µ¦¬Áä½L¥H¤Î·Æ¹«ªº¿é¤J¡CEnableWindow ªº­ì«¬¬O¡G

invoke  EnableWindow,\
        hWnd,\          ; handle to window
        bEnable         ; flag for enabling or disabling input

hWnd ¬O­n³]¬°±Ò¥Î©Î¸T¥Îªºµøµ¡©Î±±¨î¶µ¥N½X¡CbEnable ¥u¯à¬O¹s©Î¤@¡A¹s¥Nªí¸T¥Î¡A¤@¥Nªí±Ò¥Î¡C¦pªG­ì¥ý¬O¸T¥Îªº¡A¦^¶Ç­È¬°«D¹s­È¡F¦pªG­ì¥ý¬O±Ò¥Îªº¡A¦^¶Ç­È¬°¹s¡C

GetWindowRect API

GetWindowRect ¯à°÷Àò±o¬Y­Óµøµ¡ªº¥ª¤W¨¤¤Î¥k¤U¨¤®y¼Ð¡AÂǦ¹¥i­pºâµøµ¡¼e«×»P°ª«×¡C¨ä­ì«¬¦p¤U¡G

invoke  GetWindowRect,\
        hWnd,\          ; handle of window
        lpRect          ; address of structure for window coordinates

hWnd ¬O­nÀò±o¤Ø¤oªºµøµ¡¤§¥N½X¡AlpRect ¬Oµ²ºcÅé RECT ªº¦ì§}¡A¦pªG GetWindowRect °õ¦æ¦¨¥\¡ARECT µ²ºcÅé·|¦s¦³ hWnd ¥ª¤W¨¤»P¥k¤U¨¤ªº¿Ã¹õ®y¼Ð¡A¥B¦^¶Ç­È¬°¤@¡C¦pªG°õ¦æ¥¢±Ñ¡A¦^¶Ç­È¬°¹s¡C

GetWindowText API

GetWindowText ¯à°÷Àò±oµøµ¡¼ÐÃDÄ椺ªº¤å¦r¡A¤]¥i¥HÀò±o±±¨î¶µªº¤å¦r¡A¦ýµLªkÀò±o¥t¤@­ÓÀ³¥Îµ{¦¡µøµ¡¤º±±¨î¶µªº¤å¦r¡CGetWindowText ªº¥Îªk¬O¡G

invoke  GetWindowText,\
        hWnd,\          ; handle of window or control with text
        lpString,\      ; address of buffer for text
        nMaxCount       ; maximum number of characters to copy

hWnd ¬Oµøµ¡©Î±±¨î¶µ¤§¥N½X¡AGetWindowText ·|Àò±o¸Óµøµ¡¼ÐÃDÄæ©Î±±¨î¶µ¤ºªº¤å¦r¦r¦ê¡ClpString ¬°¦r¦ê¦ì§}¡AGetWindowText ·|§â©ÒÀò±oªº¦r¦ê¦s¤J¦¹¦ì§}¤¤¡CnMaxCount ¬O³Ì¦h±o¨ì¦h¤Ö¦r¤¸¡A¥]§tµ²§Àªº¹s¡A¦pªGµøµ¡¼ÐÃDÄæ©Î±±¨î¶µ¤ºªº¤å¦r¶W¹L nMaxCount¡A¨º»ò¶W¹Lªº³¡¤À·|³QºIÂ_¡A¦Ó¤£¦s¤J lpString ©Ò«üªº¦ì§}¡C

¦pªG GetWindowText °õ¦æ¦¨¥\¡A¦^¶Ç­È¬°¯u¥¿Àò±oªº¦r¤¸¼Æ¡A¤£§tµ²§Àªº¹s¡F¦pªGµøµ¡¨S¦³¼ÐÃDÄæ¡B©Î¼ÐÃDÄæ¨S¦³¤å¦r¡A©Î¬Oµøµ¡¥N½X©Î±±¥ó¶µ¥N½XµL®Ä¡A¦^¶Ç­È¬°¹s¡C

SetWindowPos API

SetWindowPos §ó§ï¤lµøµ¡¡B¼u¥Xµøµ¡©Î³»¯Åµøµ¡¡]top-level windows¡^ªº¤j¤p¡B¦ì¸m©M Z ¶b¶¶§Ç¡]¨£µù¤T¡^¡C¨ä­ì«¬¬°¡G

invoke  SetWindowPos,\
        hWnd,\           ; handle of window
        hWndInsertAfter,\; placement-order handle
        X,\              ; horizontal position
        Y,\              ; vertical position
        cx,\             ; width
        cy,\             ; height
        uFlags           ; window-positioning flags

¦U°Ñ¼Æ»¡©ú¦p¤U¡G

  1. hWnd¡G­nÅܧ󪺵øµ¡¤§µøµ¡¥N½X¡C
  2. hWndInsertAfter¡G¥i¥H¬Oµøµ¡¥N½X©Î¬O¤Uªíªº¼Æ­È¡C¦pªG¬Oµøµ¡¥N½Xªº¸Ü¡A¨º»ò²Ä¤@­Ó°Ñ¼Æ¡AhWnd¡A·|¦ì©ó hWndInsertAfter ªº¤U­±¡A·N§Y hWndInsertAfter ·|¾B¦í­nÅܧ󪺵øµ¡¡C°²¦p hWnd »P hWndInsertAfter ¬O¤£¦PÃþ«¬ªºµøµ¡¡A¤]´N¬O¤@¬°³Ì¤W¼hµøµ¡¡A¥t¤@¬°«D³Ì¤W¼hµøµ¡¡ASetWindowPos ·|Åܧó hWnd ªºÃþ«¬¡A¨Ï¤§Åܦ¨»P hWndInsertAfter ¦PÃþ«¬µøµ¡¡ChWndInsertAfter ¤]¥i¥H¬O©³¤Uªº¼Æ­È¡G
    hWndInsertAfter¼Æ­È»¡©ú
    HWND_TOP0±Nµøµ¡¸m©ó¦PÃþ«¬µøµ¡ªº³Ì¤W­±¡C¦¹³BªºÃþ«¬¥u¦³¨âºØ¡G³Ì¤W¼hµøµ¡»P«D³Ì¤W¼hµøµ¡¡C
    HWND_BOTTOM1±Nµøµ¡©ñ¦b Z ¶b¶¶§Ç³Ì¤U­±¡C­Y hWnd ­ì¥»¨ã¦³ WS_EX_TOPMOST¡A³]©w HWND_BOTTOM «á·|¥¢¥h WS_EX_TOPMOST ©µ¦ù­·®æ¡C
    HWND_TOPMOST¡Ð1±Nµøµ¡Åܬ°³Ì¤W¼hµøµ¡¡A¥B¸m©ó³Ì¤W¼hµøµ¡ªº³Ì¤W­±¡A§Y¨Ï¤£³B©ó¬¡°Êª¬ºA¡A¤]¤´µM¦p¦¹¡C
    HWND_NOTOPMOST¡Ð2±Nµøµ¡Åܬ°«D³Ì¤W¼hµøµ¡¡A¥B¸m©ó©Ò¦³«D³Ì¤W¼hµøµ¡ªº³Ì¤W­±¡A¦ý¤´¦b³Ì¤W¼hµøµ¡ªº¤U­±¡C
  3. X¡BY¡Gµøµ¡ªº·s¦ì¸m®y¼Ð¡C
  4. cx¡Bcy¡Gµøµ¡ªº·s¼e«×»P·s°ª«×¡C
  5. uFlags¡G½Õ¾ãµøµ¡¤j¤p©M¦ì¸mªººX¼Ð¡A¥i¥H¬O¤Uªí¼Æ­Èªº²Õ¦X¡G
    uFlags¼Æ­È»¡©ú
    SWP_NOSIZE1«O«ù­ì¨Óµøµ¡¼e«×»P°ª«×¡A©¿²¤ cx¡Bcy
    SWP_NOMOVE2«O«ù­ì¨Óµøµ¡¦ì¸m¡A©¿²¤ X¡BY
    SWP_NOZORDER4«O«ù­ì¨Ó Z ¶b¶¶§Ç¡A©¿²¤ hWndInsertAfter
    SWP_NOREDRAW8¤£­«·sø»s§ó§ïªº³¡¤À¡C¦pªG³]¸m¦¹ºX¼Ð¡A«h¤£·|µo¥Í­«Ã¸¡A¥]§t¤u§@°Ï¡B«D¤u§@°Ï¡]¥]¬A¼ÐÃDÄæ©M±²¶b¡^¥H¤Î¦]µøµ¡²¾°Ê¦Ó¼ÉÅSªº¤÷µøµ¡ªº³¡¤À¡C³]¸m¦¹ºX¼Ð®É¡AÀ³¥Îµ{¦¡¥²¶·«ü©w¸Óµøµ¡©Î¤÷µøµ¡µL®Ä°Ï°ì¡A¤~¯à­«·sø»s
    SWP_NOACTIVATE10H¨Ïµøµ¡Åܬ°¤£¬¡°Êªº¡C¦pªG¥¼³]¸m¦¹ºX¼Ð¡A«hµøµ¡§Y¨Ï²¾°Ê¨ì¬Y­Óµøµ¡¤U­±¡A¤´³B©ó¬¡°Êª¬ºA
    SWP_FRAMECHANGED20H§Y¨Ïµøµ¡¤j¤p¥¼§ó§ï¡A¤]·|¦Vµøµ¡µo°e WM_NCCALCSIZE °T®§¡F¦pªG¥¼«ü©w¦¹ºX¼Ð¡A¶È¦bµøµ¡¤j¤pÅܧó®Éµo°e WM_NCCALCSIZE¡C¥¦»P SWP_DRAWFRAME ¬Û¦P
    SWP_SHOWWINDOW40HÅã¥Üµøµ¡
    SWP_HIDEWINDOW80H¤£Åã¥Üµøµ¡
    SWP_NOCOPYBITS100H¥á±ó¤u§@°Ï¥þ³¡¤º®e¡C¦pªG¥¼«ü©w¦¹ºX¼Ð¡A«h¦b½Õ¾ãµøµ¡¤j¤p©Î­«·s©w¦ì«á¡A·|«O¦s¤u§@°Ïªº¤º®e¦s½Æ»s¦^¤u§@°Ï
    SWP_NOOWNERZORDER200H¤£§ïÅܾ֦³ªÌµøµ¡ªº Z ¶b¶¶§Ç¡A»P SWP_NOREPOSITION ¬Û¦P
    SWP_NOREPOSITION400Hªý¤îµøµ¡±µ¦¬ WM_WINDOWPOSCHANGING °T®§
    SWP_DEFERERASE2000H¨¾¤î¥Í¦¨ WM_SYNCPAINT °T®§
    SWP_ASYNCWINDOWPOS4000HWindows ·|¬°¨C­Ó°õ¦æºü¡]thread¡^«Ø¥ß¦U¦Ûªº°T®§¦î¦C¡C¦pªG©I¥s SetWindowPos ªº°õ¦æºü»P¤÷µøµ¡ªº°õ¦æºü¤£¦P¡A¨º»ò°T®§¦î¦C¤]¤£¦P¡AWindows ¨t²Î·|±N°T®§µo¥¬¨ì¤÷µøµ¡ªº°õ¦æºü¡C³o¼Ë¥i¥H¨Ï©I¥s SetWindowPos ªº°õ¦æºü¤£¶·µ¥«Ý SetWindowPos §¹¦¨¡A´N¯àÄ~Äò³B²z¨ä¥L¤u§@¡C¡]¦³Ãö°õ¦æºü­n«Ü¤[ªº¥H«á¦A»¡©ú¡^

¦pªG SetWindowPos °õ¦æ¦¨¥\¡A¦^¶Ç­È¬°¤@¡F­Y¥¢±Ñ¡A¦^¶Ç­È¬°¹s¡C

BM_SETIMAGE °T®§

À³¥Îµ{¦¡¥i¥H§â BM_SETIMAGE ¶Çµ¹«ö¶s¡A¨Ï«ö¶sÅã¥Ü¹Ï¥Ü©Î¦ì¤¸¹Ï¡C¤è¦¡¦p¤U¡G

invoke  SendMessage,hButton,BM_SETIMAGE,wParam,lParam

¨ä¤¤ wParam ¥u¯à¬O IMAGE_ICON¡BIMAGE_BITMAP ¤GªÌ¨ä¤¤¤§¤@¡AlParam ¬O¨Ì¾Ú wParam ¦Ó¿ï¾Ü­nÅã¥Ü¦b«ö¶s¤Wªº¹Ï¥Ü¥N½X©Î¦ì¤¸¹Ï¥N½X¡C

¥i¥H§â¤å¦r»P¹Ï¤ù¡]¦¹³Bªº¹Ï¤ù¥i¯à¬O¹Ï¥Ü©Î¦ì¤¸¹Ï¡^¦P®ÉÅã¥Ü©ó«ö¶s¤W¡A¨ú¨M©ó«ö¶s¬O§_¨ã¦³ BS_ICON ©Î BS_BITMAP ­·®æ¡A¥H¤Î¬O§_©I¥s¤F¥H BM_SETIMAGE ¬°°Ñ¼Æªº SendMessage¡C¨£¤Uªí¡G

¬O§_¨ã¦³ BS_ICON
©Î BS_BITMAP
¬O§_¥H BM_SETIMAGE
¬°°Ñ¼Æ©I¥s SendMessage
µ²ªG
¬O¬O¥uÅã¥Ü¹Ï¤ù
§_¬O¦P®ÉÅã¥Ü¤å¦r»P¹Ï¤ù
¬O§_¥uÅã¥Ü¤å¦r
§_§_¥uÅã¥Ü¤å¦r

°£¦¹¤§¥~¡A­n¦P®ÉÅã¥Ü¤å¦r¤Î¹Ï¤ùÁÙ¦³­Ó±ø¥ó¡A¥²¶·¦b¸ê·½´y­zÀɨϥΠDIALOG °Ï¶ô¡A¨Ã¥B¥Î DIALOG °Ï¶ôùØ­±ªº CONTROL¡BPUSHBUTTON¡BDEFPUSHBUTTON «Ø¥ß«ö¶s¡A¤£¯à©I¥s CreateWindowEx «Ø¥ß«ö¶s¡]¤U¤@³¹·|´£¨ì¨Ï¥Î DIALOG °Ï¶ô«Ø¥ß±±¨î¶µ¡^¡C


µù¤G

©³¤U»¡©ú¦p¦ó«Ø¥ß¤U©Ô¦¡¤À³Î«ö¶s¡A¥H¤Î¸Ó«ö¶sµo¥X WM_NOTIFY °T®§®É¦p¦ó³B²z¼u¥X¥\¯àªí¡A³Ì«á¦p¦ó³B²zÂI¿ï¸Ó¼u¥X¥\¯àªí¤¤¿ï¶µ®Éµo¥Xªº WM_COMMAND °T®§¡C¨Ò¤l¤¤¶È¦C¥X¬ÛÃöªºµ{¦¡½X¡A¦Ó¬Ù²¤¨ä¥Lµ{¦¡½X¡C

BS_SPLITBUTTON  EQU     12

.CONST
szClass DB      "BUTTON",0
szText  DB      "½Ð¿ï¾Ü",0
szOne   DB      "1",0
szTwo   DB      "2",0
szThree DB      "3",0

.DATA
hBtn    DQ      ?       ;¤U©Ô¦¡¤À³Î«ö¶sªº¥N½X
hMenu   DQ      ?       ;¼u¥X¥\¯àªí¥N½X

.CODE
WndProc PROC    hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL   rect:RECT
.switch uMsg
  .case WM_CREATE
        ;«Ø¥ßÃѧO½X¬°5000ªº¤U©Ô¦¡¤À³Î«ö¶s
        invoke  CreateWindowEx,0,OFFSET szClass,OFFSET szText,WS_CHILD or WS_VISIBLE\
                or BS_SPLITBUTTON,10,10,150,28,hWnd,5000,hInstance,0
        mov     hBtn,rax
        ;«Ø¥ß¼u¥X¥\¯àªí¡A¨Ã¥[¤J¡u1¡v¡B¡u2¡v¡B¡u3¡v¤T­Ó¿ï¶µ
        call    CreatePopupMenu
        mov     hMenu,rax
        invoke  AppendMenu,hMenu,MF_STRING,1,OFFSET szOne
        invoke  AppendMenu,hMenu,MF_STRING,2,OFFSET szTwo
        invoke  AppendMenu,hMenu,MF_STRING,3,OFFSET szThree

  .case WM_NOTIFY
        ASSUME  r10:PTR NMHDR
        mov     r10,lParam
    .if [r10].code==BCN_DROPDOWN
      .if r8w==5000
        ;·í¨Ï¥ÎªÌ«ö¤U¤U©Ô¦¡¤À³Î«ö¶s®É¡A©ó¤U©Ô¦¡¤À³Î«ö¶s¤U¤èÅã¥Ü¼u¥X¥\¯àªí¡A¥H¨Ñ¿ï¾Ü
        invoke  GetWindowRect,[r10].hwndFrom,ADDR rect
        invoke  TrackPopupMenu,hMenu,TPM_LEFTALIGN or TPM_TOPALIGN or TPM_VERNEGANIMATION,\
                rect.left,rect.bottom,0,hWnd,0
        ASSUME  r10:NOTHING
      .endif
    .endif

  .case WM_COMMAND
        mov     rax,r8  ;R8W¡×ÃѧO½X
        shr     rax,16  ;­Y AX¡×0¡A¨Ï¥ÎªÌ¿ï¾Ü¬Y­Ó¿ï¶µ¡FAX ¤£¬° 0¡A¬°±±¨î¶µ³qª¾½X
    .if ax==0
      .if r8w==1
        ;¨Ï¥ÎªÌ¿ï¾Ü¼u¥X¿ï¶µ¤¤ªº¡u1¡v
      .elseif r8w==2
        ;¨Ï¥ÎªÌ¿ï¾Ü¼u¥X¿ï¶µ¤¤ªº¡u2¡v
      .elseif r8w==3
        ;¨Ï¥ÎªÌ¿ï¾Ü¼u¥X¿ï¶µ¤¤ªº¡u3¡v
      .endif
    .endif

µù¤T¡GZ ¶b¶¶§Ç¡]Z¡ÐOrder¡^

¦b Windows §@·~¨t²Îªº®à­±¤W¡A¥i¯à·|¥X²{«Ü¦h­Óµøµ¡¡C³o¨Çµøµ¡¥i¯à­«Å|¦b¤@°_¡A¦³¨Ç¦b¤W­±¡A¯à³Q¨Ï¥ÎªÌ¬Ý¨£¡F¦³¨Ç³Q¨ä¥Lµøµ¡¾×¦í¡A¨Ï¥ÎªÌ¥u¬Ý¨£µøµ¡ªº¤@³¡¤À¡F¤]¦³®É­Ô¬O¤@­Óµøµ¡ÅQ¦û¾ã­Ó®à­±¡A¨ä¥Lµøµ¡³£³Q¨ä¾B¾×¡CWindows ¬O«ç»ò¨M©w­þ­Óµøµ¡¦b³Ì¤W­±¡A¨Ï¥ÎªÌ¯à¬Ý¨£¥þ»ª¡F­þ­Óµøµ¡¦b©³¤U¡A³Q¾B¦í¥u¯à¬Ý¨£¤@³¡¥÷©Î¥þ¬Ý¤£¨ì©O¡H

¹q¸£¿Ã¹õ¬O¤G«×ªÅ¶¡ªº¥­­±¡A¥H¥ª¤W¨¤¬°­ìÂI¡A¨ä X ¶b¥¿¤è¦V±q­ìÂI¦V¥k¤ô¥­¤è¦V©µ¦ù¡AY ¶b¥¿¤è¦V«h±q­ìÂI¦V¤U©µ¦ù¡C¦pªG®à­±¤W¦P®É¦³³\¦hµøµ¡­«Å|®É¡A­n¯à°Ï¤À¨C­Óµøµ¡«e«á¦ì¸mªºÃö«Y¡A´N­n§â¿Ã¹õ·Q¹³¦¨¤T«×ªÅ¶¡¡A¤]´N¬O·Q¹³¦¨¨ã¦³°ª«×¡CWindows §@·~¨t²Î¥H²Ä¤T­Ó®y¼Ð¶b¡AZ ¶bªí¥Ü°ª«×¡A¨ä¥¿¤è¦V¥Ñ¿Ã¹õ©¹¨Ï¥ÎªÌ¤è¦V©µ¦ù¡A¦p¥k¹Ï¡CÁöµM Z ¶b¤è¦V­ì¥»¬O¤ô¥­ªº¡A¦ý­n§â¥¦·Q¹³¦¨°ª«×¡A¶V©¹¿Ã¹õ©Ò¦bªº¦a¤è¬O¤U¤è¡A¶V©¹¨Ï¥ÎªÌ¤è¦V¬O¶V©¹¤W¤è¡C

Windows §@·~¨t²Î·|¹ï©Ò¦³Åã¥Ü¦b¿Ã¹õ¤Wªºµøµ¡¡A½á¤©¤@­ÓºÙ¬°¡uZ ¶b¶¶§Ç¡vªº¼Æ­È¡A¨Ã±N¦¹¼Æ­È«O¦s©ó¤@±i¦Cªí¤¤¡CWindows ´N¨Ì¾Ú¡uZ ¶b¶¶§Ç¡v¨M©w­þ¤@­Óµøµ¡¦b¤W­±¡A­þ¤@­Ó¦b¤U­±¡C¦b³o¤@³¹ùØ¡A¤p¤ì°¸¥Î¤W¡B¤U¤è¥Nªí Z ¶b¶¶§Ç¡AZ ¶b¶¶§Ç³Ì¤W­±ªºµøµ¡·|¾B¦í¤U­±ªºµøµ¡¡A¨Ï¥ÎªÌ¯à¬Ý¨ì³Ì¤W­±µøµ¡ªº¥þ»ª¡C

¦Ó¨M©w¡uZ ¶b¶¶§Ç¡vªº¤èªk¡A»Pµøµ¡ªº©Ê½è©M¨Ï¥ÎªÌ°Ê§@¦³Ãö¡A¥ý¸ÑÄÀ´X­Óµøµ¡ªº©Ê½è¡G

①¡B³Ì¤W¼hµøµ¡»P«D³Ì¤W¼hµøµ¡¡G­ì¤å¤À§O¬O topmost windows¡Bnon-topmost windows¡C«eªÌ¬O«ü¨ã¦³ WS_EX_TOPMOST ©µ¦ù­·®æªºµøµ¡¡F«áªÌ«h¤£¨ã¦³ WS_EX_TOPMOST ©µ¦ù­·®æªºµøµ¡¡C
②¡B³»¯Åµøµ¡¡G­ì¤å¬O top-level windows¡A¬O«ü¨S¦³¤÷µøµ¡ªºµøµ¡©ÎªÌ¤÷µøµ¡¬O®à­±ªºµøµ¡¡C
③¡B¤lµøµ¡¡G­ì¤å¬O child windows¡A¬O«üÀRºA±±¨î¶µ¡B«ö¶s¡B½s¿è®Øµ¥µøµ¡¡A¤]ºÙ±±¨î¶µ¡C
④¡B¦P¯Åµøµ¡¡G­ì¤å¬O sibling windows¡A¤]½Ķ¦¨¥S§Ìµøµ¡¡A¬O«ü¦P¤@¤÷µøµ¡¤Uªº©Ò¦³¤lµøµ¡¡C
⑤¡B¬¡°Êªºµøµ¡»P«D¬¡°Êªºµøµ¡¡G­ì¤å¤À§O¬O active windows¡Binactive windows¡C¬¡°Êªºµøµ¡¬O«ü·í«e¥¿¦b»P¨Ï¥ÎªÌ¤¬°Êªºµøµ¡¡A¥¦¬O¥Ø«e±µ¦¬Áä½L¿é¤J©M¨Ï¥ÎªÌ¥¿¦b¾Þ§@ªºµøµ¡¡A¨ä¥~®Ø»P¼ÐÃDÄ檺ÃC¦â¸û¬°ÂA©ú¡C«D¬¡°Êªºµøµ¡«h¤£¨ãÁä½L¿é¤JµJÂI¡A¨ä¥~®Ø»P¼ÐÃDÄ檺ÃC¦â¸û¬°Åf²H¡C¦P¤@®É¶¡¤º¡A¥u¦³¤@­Ó¬¡°Êªºµøµ¡¡A¦Ó¨ä¥Lªºµøµ¡³£¬O«D¬¡°Êªºµøµ¡¡C
⑥¡B®à­±µøµ¡¡G­^¤å¬O desktop window¡A¨ä¹ê´N¬O Windows §@·~¨t²Îªº®à­±¡A¥¦¬O©Ò¦³³»¯Åµøµ¡ªº¤÷µøµ¡¡A¤]¬O®à­±ªº­I´º¡A¥¦ªº Z ¶b¶¶§Ç¬O¦b©Ò¦³³»¯Åµøµ¡ªº¤U­±¡C

¸ÑÄÀ§¹³o¨Ç°ò¥»ªºµøµ¡©Ê½è«á¡A¥i¥H¨Ó½Í½Í¨M©w Z ¶b¶¶§Çªº³W«h¤F¡A´N¥u¦³¤U­±´X­Ó³W«h¡G

①¡B©Ò¦³³Ì¤W¼hµøµ¡ªº Z ¶b¶¶§Ç¥²©w¦ì©ó©Ò¦³«D³Ì¤W¼hµøµ¡ªº¤W­±¡C
②¡B·s²£¥Í³»¯Åµøµ¡®É¡A¸Óµøµ¡ªº Z ¶b¶¶§Ç¦ì©ó¦PÃþ«¬µøµ¡ªº³Ì¤W­±¡C
③¡B·í¤@µøµ¡¤¤¥Í¦¨¤lµøµ¡®É¡A³o­Ó¤lµøµ¡ªº Z ¶b¶¶§Ç¦ì©ó¤÷µøµ¡¤W¤è¡A¦ý³£¤£·|¶W¹L¤÷µøµ¡¤W¤èªº¥S§Ìµøµ¡¡C¦Ó¥B¶V«á«Ø¥ßªº¤lµøµ¡ Z ¶b¶¶§Ç¶V¤W­±¡C
④¡B·í¨Ï¥ÎªÌ¥H·Æ¹«ÂI¿ï¬Y­Óµøµ¡¨Ï¸Óµøµ¡Åܬ°¬¡°Êªºµøµ¡¡A¸Óµøµ¡ªº Z ¶b¶¶§Ç·|Åܦ¨¦PÃþ«¬µøµ¡ªº³Ì¤W­±¡C

Á|­Ó¨Ò¤l»¡©ú³o¨Ç³W«h¡C¤p¤ì°¸±`±`¤@Ãä¥Î UltraEdit ¼gµ{¦¡¡A¤@Ãä¥Î¤õª°¯WÂsÄý¾¹Å¥ YouTube ¤Wªº­µ¼Ö¡A¦Ó¥B¬O¥H¤l¥Àµe­±Å¥­µ¼Ö¶¶«K¤]¯àªY½à¼v¤ù¡C¤p¤ì°¸¦b UltraEdit ¤¤¥HÁä½L¿é¤Jµ{¦¡½X¦Ó¤£¬O¦b¤l¥Àµe­±¿é¤Jµ{¦¡½X¡A¦ý¤l¥Àµe­±¨ÌµM·|¾B¦í UltraEdit µøµ¡¡F©Ò¥H¤l¥Àµe­±¬O³Ì¤W¼hµøµ¡¡A¦Ó¥B¬O«D¬¡°Êªºµøµ¡¡FUltraEdit «h¬O«D³Ì¤W¼hµøµ¡¡A¥¦¬O³»¯Åµøµ¡¡]¦]¬° UltraEdit ¨S¦³¤÷µøµ¡¡^¡A¤]¬O¬¡°Êªºµøµ¡¡C

°²³]²{¦b¦A±Ò°Ê Edge ÂsÄý¾¹¡A¤@¼Ë¥Î¤l¥Àµe­±¬Ý YouTube ¤Wªº¼v¤ù¡A³o­Ó¤l¥Àµe­±¤]¬O³Ì¤W¼hµøµ¡¡A¥¦·|Âл\¦b¤õª°¯WÂsÄý¾¹ªº¤l¥Àµe­±¤W¡A¦]¬° Edge ÂsÄý¾¹«á±Ò°Ê¡A©Ò¥H¥¦ªº Z ¶b¶¶§Ç·|¦b¤õª°¯WÂsÄý¾¹ªº¤l¥Àµe­±¤§¤W¡C