Windows §@·~¨t²Î´£¨Ñ¤@¨Ç¤w¸g³]p¦nªº¹ï¸Ü²°¥i¨Ñµ{¦¡³]p®vª½±µ¨Ï¥Î¡AºÙ¬°³q¥Î¹ï¸Ü²°¡]common dialog boxes¡^¡A¥¦¤£»Ýn¹³«e´X³¹ªº¹ï¸Ü²°¡An¥ý¦b¦b¸ê·½´yzÀɤ¤¥Î DIALOG ©Î DIALOGEX °Ï¶ô©w¸q¡AµM«á¥Î¸ê·½½sĶ¾¹½sĶ¡A©Ò±o¨ìªº¸ê·½ÀɦA¥Î³sµ²¾¹»P¥ØªºÀɳsµ²¡F³q¥Î¹ï¸Ü²°¥u»Ý©I¥s¤Uªí¤¤ªº Win64 API §Y¥i²£¥Í¡A·íµM¦b©I¥s³o¨Ç Win64 API ¤§«e¥²¶·±N°Ñ¼Æ³]©w¦n¡A¦Ó³o¨Ç°Ñ¼Æ³£¬O½ÆÂøªºµ²ºcÅé¡C±`¨£ªº³q¥Î¹ï¸Ü²°¦³¤U±´XºØ¡G
³q¥Î¹ï¸Ü²° | n©I¥sªº API | n¨Ï¥Îµ²ºcÅé |
³]©wÃC¦â | ChooseColor | CHOOSECOLOR |
·j´M | FindText | FINDREPLACE |
¨ú¥N | ReplaceText | FINDREPLACE |
³]©w¦r«¬ | ChooseFont | CHOOSEFONT |
¶}±ÒÂÂÀÉ | GetOpenFileName | OPENFILENAME |
¥t¦s·sÀÉ | GetSaveFileName | OPENFILENAME |
ª©±³]©w | PageSetupDlg | PAGESETUPDLG |
¿ï¾Ü¥Ø¿ý | SHBrowseForFolder | BROWSEINFO |
¨Ò¦pn²£¥Í¡u¶}±ÒÂÂÀÉ¡v³q¥Î¹ï¸Ü²°¡A»Ý¥ý³]©w¦n OPENFILENAME µ²ºcÅ骺ÓÄæ¦ì¡AµM«á©I¥s GetOpenFileName API¡CÁöµM³q¥Î¹ï¸Ü²°ªººØÃþ«Ü¦h¡A¦ý³o¤@³¹¥uµÛ«¦b¡u¶}±ÒÂÂÀÉ¡v³q¥Î¹ï¸Ü²°¡C
ÅU¦W«ä¸q¡A¶}±ÒÂÂÀɳq¥Î¹ï¸Ü²°¬O¥Î©ó¨ú±oÀɮצWºÙªº¹ï¸Ü²°¡C®Ú¾Ú¦b OPENFILENAME ¤¤¤£¦Pªº³]©w¡A¥¦ªº°õ¦æµe±¦³¦hºØ¤£¦Pªº¼Ë¤l¡A¦ý¬O¥Dn¥i¤À¬°¨âÃþ¡G·®æ¡]old-style¡A¥ç½Ķ¦¨Â¼˦¡¡^»PÁ`ºÞ·®æ¡]explorer-style¡A¤]½Ķ¦¨Á`ºÞ¼Ë¦¡¡B±´ÀIªÌ¼Ë¦¡µ¥¡^¡C¤U¹Ï¬O¦b Windows 7 §@·~¨t²Î²£¥Íªº¶}
±ÒÂÂÀɹï¸Ü²°¡A¨âªÌ³£¬O©I¥s GetOpenFileName ²£
¥Íªº¡A¹Ï¤@¬O·®æ¡A¹Ï¤G¬OÁ`ºÞ·®æ¡C¨Ï¥ÎªÌ¥i¥H¥Î·Æ¹«¥ªÁä¦bÀɮצCªí¤¤¿ï¾ÜÀɮסA¨£¤W±¨â¹Ï¤¤·Æ¹«´å¼Ð¿ï©wªº¡u97f1logu00.bmp¡vÀɮסA¸ÓÀɮתº¦WºÙ·|¥X²{¦b¡uÀɦW¡]N¡^¡G¡v©Î¡uÀɮצWºÙ¡]N¡^¡G¡v¤§«áªº½s¿è®Ø¤º¡]¬õ¦â®Ø¡^¡AµM«á«ö¤U¡u½T©w¡v©Î¡u¶}±Ò¡v«ö¶s¡A´N¯àÀò±o©Ò¿ï¾ÜªºÀɮצWºÙ¡A¦bÀ³¥Îµ{¦¡ùر¥i¥H§@¬°«áÄò³B²zªº¸ê®Æ¡A«Ü¤è«K¦Ó¥B©ö©ó¨Ï¥Î¡C©³¤U¤¶²Ð GetOpenFileName API¡C
GetOpenFileName ªºì«¬¦p¤U¡G
invoke GetOpenFileName,\
lpofn ; address of structure with initialization data
¥¦¥u¦³¤@ӰѼơAOPENFILENAME µ²ºcÅ骺¦ì§}¡C©I¥s GetOpenFileName ¤§«e¡A¶·³]©w¦n¦¹µ²ºcÅ骺Äæ¦ì¡AGetOpenFileName ¥Ñ¦¹µ²ºcÅéÀò±o©Ò»Ý¸ê®Æ¡A¨Ã§â¥t¥~¤@¨Ç¸ê®ÆÂǥѦ¹µ²ºcÅé¡A¶Ç¦^µ¹À³¥Îµ{¦¡¡A¨Ñ¨ä¨Ï¥Î¡C
¦pªG¨Ï¥ÎªÌ¦³¿ï©w¬YÓÀɮסA¥B«ö¤U¡u½T©w¡v©Î¡u¶}±Ò¡v«ö¶s¡A¦^¶ÇȬ°«D¹s¡A¥B OPENFILENAME ªº lpstrFile Äæ¦ì©Ò«ü¦ì§}¤W¦s¦³¥]§tºÏºÐ¾÷¦WºÙ¡B¸ô®|¦Wªº§¹¾ãÀɮצWºÙ¡C¦pªG¨Ï¥ÎªÌ«ö¤U¡u¨ú®ø¡v«ö¶s©Î«ö¤U¥k¤W¨¤ªºÃö³¬«ö¶s¡A¦^¶ÇȬ°¹s¡A¥i©I¥s CommDlgExtendedError Àò±o¶i¤@¨Bªº¿ù»~°T®§¡C
OPENFILENAME µ²ºcÅé¶È¥Î©ó©I¥s GetOpenFileName »P GetSaveFileName ¨âÓ Win64 API ªº°Ñ¼Æ¡A«eªÌ·|¼u¥X¡u¶}±ÒÂÂÀÉ¡v¹ï¸Ü²°¡A«áªÌ·|¼u¥X¡u¥t¦s·sÀÉ¡v¹ï¸Ü²°¡C¦b WinInc ªº COMMDLG.INC §t¤JÀɤ¤¡AOPENFILENAME ªº©w¸q¦³¿ù¡A¥²¶·n¦³¹ï»ôÈ¡A¦b STRUCT ¤§«á¥²¶·¥[¤W¹ï»ôÈ 8¡A´N¦p¦P©³¤U OPENFILENAME ©Ò©w¸qªº¼Ë¤l¡G
OPENFILENAME STRUCT 8 lStructSize DWORD ? ;① OPENFILENAMEµ²ºcÅéªø«× hwndOwner HWND ? ;② ¾Ö¦³¦¹¹ï¸Ü²°ªºµøµ¡¥N½X hInstance HINSTANCE ? ;③ ¼Ò²Õ¥N½X lpstrFilter LPWSTR ? ;④ ¿z¿ï¦r¦ê¦ì§} lpstrCustomFilter LPWSTR ? ;⑤ ¦Û¦æ©w¸qªº¿z¿ï¦r¦ê¦ì§} nMaxCustFilter DWORD ? ;⑥ lpstrCustomFilter©Ò«ü½w½Ä°Ï¤j¤p nFilterIndex DWORD ? ;⑦ ¹w³]ªº¿z¿ï¦r¦ê lpstrFile LPWSTR ? ;⑧ ¦s©ñ§¹¾ãÀɦWªº½w½Ä°Ï¦ì§} nMaxFile DWORD ? ;⑨ lpstrFile©Ò«ü½w½Ä°Ï¤j¤p lpstrFileTitle LPWSTR ? ;⑩ ÀɦW¦ì§} nMaxFileTitle DWORD ? ;⑪ lpstrFileTitle©Ò«ü½w½Ä°Ï¤j¤p lpstrInitialDir LPWSTR ? ;⑫ ªì©l¥Ø¿ý¦ì§} lpstrTitle LPWSTR ? ;⑬ ¼ÐÃDÄæ¦r¦êªº¦ì§} Flags DWORD ? ;⑭ ºX¼Ð nFileOffset WORD ? ;⑮ ÀɦW¦b§¹¾ãÀɦWªº²Ä´XÓ¦r¤¸ nFileExtension WORD ? ;⑯ °ÆÀɦW¦b§¹¾ãÀɦWªº²Ä´XÓ¦r¤¸ lpstrDefExt LPWSTR ? ;⑰ ¹w³]°ÆÀɦW¦ì§} lCustData LPARAM ? ;⑱ ¶Çµ¹ÄdºI¨ç¦¡¦Û¦æ©w¸qªº¸ê®Æ lpfnHook QWORD ? ;⑲ ÄdºI¨ç¦¡¦ì§} lpTemplateName LPWSTR ? ;⑳ ¹ï¸Ü²°±ªO¦WºÙªº¦ì§} IF (_WIN32_WINNT GE 500h) ;㉑ Windowsª©¥»NT 5.0¤Î¨ä¥H«áª©¥»¤~¦³ªºÄæ¦ì pvReserved DWORD ? ;㉒ «O¯dªºÄæ¦ì¡AÀ³³]¬°0 dwReserved DWORD ? ;㉓ «O¯dªºÄæ¦ì¡AÀ³³]¬°0 FlagsEx DWORD ? ;㉔ ÂX¥RªººX¼Ð ENDIF OPENFILENAME ENDS
OPENFILENAME µ²ºcÅ骺Äæ¦ì«Ü¦h¡A©³¤U²²¤¤¶²Ð¡G
"¦ì¤¸¹Ï",0,"*.BMP",0,0°²¦pn¦b¶}±ÒÂÂÀɹï¸Ü²°n¬D¿ï¦ì¤¸¹Ï©ÎªÌ¥t¤@ºØ±`¨£ªºÀ£ÁY¹Ï¤ùÀÉ¡u.JPG¡v¡A¨º»ò¿z¿ï¦r¦ê´N¦³¨â²Õ¡C¦Ó JPG Àɪº°ÆÀɦW¥i¥H¬O¡u.JPG¡v¤]¥i¥H¬O¡u.JPEG¡v¡A¹³³o¼Ë¤@ÓÅã¥Ü¦r¦ê·f°t¦hÓ¿z¿ï§Î¦¡¦r¦ê®É¡A¥i¥H¥Î¤À¸¹¡];¡^¨Ó¤À¹j¥¦Ì¡A¦p¤U¡G
"¦ì¤¸¹Ï",0,".BMP",0 "À£ÁY¹ÏÀÉ",0,"*.JPG;*.JPEG",0,0¿z¿ï§Î¦¡¦r¦ê¤]¥i¥H¥Ñ¦³®ÄªºÀɦW¦r¤¸©M¸U¥Î¦r¤¸¡u*¡v²Õ¦¨¡A¦ý¤£¥i¨Ï¥ÎªÅ®æ¡C¨Ò¦p©³¤Uªº¨Ò¤l¥u·|¦b²M³æ²°±±¨î¶µ¤ºÅã¥Ü¥H¡u9¡v¶}ÀYªº BMP ÀɮסG
"ÀɦW¬° 9 °_ÀYªº¦ì¤¸¹Ï",0,"9*.BMP",0,0¦b¤U©Ô¦¡¤è¶ô±±¨î¶µÅã¥ÜªºÅã¥Ü¦r¦ê¶¶§Ç¡A¬O«ö·Ó lpstrFilter ¤¤«ü©wªº¶¶§Ç¡C¦pªG lpstrFilter ¬° NULL¡A«h¹ï¸Ü²°¤£·|Åã¥Ü¥ô¦óÅã¥Ü¦r¦ê¡A¦Ó²M³æ²°±±¨î¶µ·|Åã¥Üªì©l¥Ø¿ý¤ºªº©Ò¦³ÀɮסC
"²Õ¦X»y¨¥",0,"*.ASM",0 "¶W¤å¥»¼Ð°O»y¨¥",0,"*.HTML;*.HTM",0 "C»y¨¥",0,"*.C",0,0¦Ó nFilterIndex ³]¬° 1¡A¨º»òµe±¦p¥k¹Ï¤T¡C
Flags | »¡©ú |
OFN_READONLY 1 | ¨Ï¡u°ßŪ¡v½Æ¿ï®Ø¦b¹ï¸Ü²°¤@¶}©l«Ø¥ß®É¡A¬°¿ï¤¤ª¬ºA¡C |
OFN_OVERWRITEPROMPT 2 | OFN_OVERWRITEPROMPT ¥u¦³¦b©I¥s GetSaveFileName ¦³®Ä¡C·í¨Ï¥ÎªÌ¿ï¾Ü¤w¦s¦bªºÀɮ׮ɡA¨t²Î·|ĵ§i¸ÓÀɮפw¦s¦b¡A¬O§_n¨ú¥N¡H¦pªG¦^µª¡u¬O¡v¡A¥t¦s·sÀɹï¸Ü²°³Q¾P·´¦^¨ììÀ³¥Îµ{¦¡¡F¦pªG¦^µª¡u§_¡v¡Aªð¦^¥t¦s·sÀɹï¸Ü²°Åý¨Ï¥ÎªÌÄ~Äò¿ï¾Ü¡C |
OFN_HIDEREADONLY 4 | ¤£Åã¥Ü¡u°ßŪ¡v½Æ¿ï®Ø¡C |
OFN_NOCHANGEDIR 8 | ¦pªG¨Ï¥ÎªÌ¦b©I¥s GetSaveFileName ¼u¥Xªº³q¥Î¹ï¸Ü²°¤¤¡A·j´MÀÉ®×®ÉÅܧó¤u§@¥Ø¿ý¡Aªð¦^®É·|±N¥Ø¿ýÁÙ쬰©I¥s«eªº¤u§@¥Ø¿ý¡C¦ý¦¹ºX¼Ð¹ï GetOpenFileName µL®Ä¡C |
OFN_SHOWHELP 10h | Åã¥Ü»¡©ú«ö¶s¡C·í¨Ï¥ÎªÌ«ö¤U¸Ó«ö¶s«á¡AÄdºIµ{¦¡¦¬¨ì WM_NOTIFY °T®§¡A¦¹°T®§¤¤·|§t¦³ CDN_HELP ³qª¾½X¡AÄdºI¨ç¦¡»Ý³B²z¦¹³qª¾½X¡]¨£ WM_NOTIFY¡^¡C¦]¦¹¥²¶·¦b Flags ³]©w OFN_ENABLEHOOK¡A¨Ã¥B¦b lpfnHook Äæ¦ì³]©wÄdºI¨ç¦¡¦ì§}¡C |
OFN_ENABLEHOOK 20h | ¦¹ºX¼Ð±Ò¥Î lpfnHook Äæ¦ì¡C |
OFN_ENABLETEMPLATE 40h | ¦¹ºX¼Ð±Ò¥Î lpTemplateName Äæ¦ì¡C |
OFN_ENABLETEMPLATEHANDLE 80h | |
OFN_NOVALIDATE 100h | ¹w³]±¡§Î¤U¡A¨Ï¥ÎªÌ¦b½s¿è®Ø¤º¿é¤JªºÀɦW§t¤£¦Xªk¦r¤¸¡A«ö¤U¡u¶}±Ò¡v«ö¶s«á¨t²Î·|´£¥Xĵ§i¡A¨Ãªð¦^³q¥Î¹ï¸Ü²°Åý¨Ï¥ÎªÌÄ~Äò¿ï¾Ü¡C¦ý³]©w OFN_NOVALIDATE «á¡A¨t²Î¤£ÅçÃÒÀɮצWºÙ¡A¤¹³\¨Ï¥ÎªÌ©ó½s¿è®Ø¿é¤JµL®ÄÀɦW¡C |
OFN_ALLOWMULTISELECT 200h | ¤¹³\¨Ï¥ÎªÌ¬D¿ï¦hÓÀɮסCY Flags §t OFN_ALLOWMULTISELECT »P OPN_EXPLORER¡A¨º»ò¨Ï¥Î¡uÁ`ºÞ·®æ¡v¡FY¥u§t OFN_ALLOWMULTISELECT ¦ý¤£§t OPN_EXPLORER¡A¨º»ò·|¨Ï¥Î¡u·®æ¡v¡C |
OFN_EXTENSIONDIFFERENT 400h | ·í¨Ï¥ÎªÌ¿é¤Jªº°ÆÀɦW»P lpstrDefExt ©Ò«ü©wªº°ÆÀɦW¤£¦P¡A¨º»ò·í GetOpenFileName ©Î GetSaveFileName ªð¦^®É¡A¨t²Î·|¦b Flags ³]©w OFN_EXTENSIONDIFFERENT ºX¼Ð¡AÀ³¥Îµ{¦¡¥iÀˬd¬O§_§t¦¹ºX¼Ð¦Ó°µ«áÄò³B²z¡C¦pªG lpstrDefExt ¬°¹s¡A¨º»ò´N¤£¨Ï¥Î¦¹ºX¼Ð¡C |
OFN_FILEMUSTEXIST 1000h | ³]©w OFN_FILEMUSTEXIST «á¡A¨Ï¥ÎªÌ¦pªG¦b½s¿è®Ø¿é¤J¤£¦s¦bªºÀɮרëö¤U¶}±Ò«ö¶s¡A¨t²Î·|¼u¥X¤@¹ï¸Ü²°Äµ§i§ä¤£¨ì¸ÓÀɮסA¨Ãªð¦^³q¥Î¹ï¸Ü²°¤ºÄ~ÄòÅý¨Ï¥ÎªÌ¿ï¾Ü¡C |
OFN_CREATEPROMPT 2000h | ·í¨Ï¥ÎªÌ¿é¤J¤£¦s¦bªºÀɮ׮ɡA¦¹ºX¼Ð·|¾ÉP¹ï¸Ü²°´£¥Ü¨Ï¥ÎªÌ¬O§_«Ø¥ßÀɮסC¦pªG¨Ï¥ÎªÌ¿ï¾Ü«Ø¥ßÀɮסA¹ï¸Ü¤è²°·|Ãö³¬¡AGetOpenFileName ©Î GetSaveFileName ·|¶Ç¦^¿é¤JªºÀɦW¨ÑÀ³¥Îµ{¦¡¶i¦æ«áÄò³B²z¡F§_«h¡Aªð¦^¹ï¸Ü²°¤è¶ô¡C¦pªG¦¹ºX¼Ð¦P®ÉÁÙ·f°t OFN_ALLOWMULTISELECT¡A¨º»ò¨t²Î¥u¶Ç¦^²Ä¤@ÓÀɮצWºÙ¡C |
OFN_SHAREAWARE 4000h | «ü©w¦pªG OpenFile ¨ç¦¡ªº©I¥s¦]¬°ºô¸ô¦@¥Î¹H³W¦Ó¥¢±Ñ¡A«h·|©¿²¤¿ù»~¡A¦Ó¥B¹ï¸Ü²°·|¶Ç¦^¿ï¨úªºÀɮצW¡C¦pªG¥¼³]©w¦¹ºX¼Ð¡A¹ï¸Ü²°·|¦b¨Ï¥ÎªÌ«ü©wªºÀɮצWµo¥Íºô¸ô¦@¥Î¹H³W®É³qª¾±zªºÄdºIµ{¦¡¡C¦pªG±z³]©w OFN_EXPLORER ºX¼Ð¡A¹ï¸Ü²°·|±N CDN_SHAREVIOLATION °T®§¶Ç°e¦ÜÄdºIµ{¦¡¡C¦pªG±z¥¼³]©w OFN_EXPLORER¡A¹ï¸Ü¤è¶ô·|±N SHAREVISTRING ¤wµù¥Uªº°T®§¶Ç°e¦ÜÄdºI¨ç¦¡¡C |
OFN_NOREADONLYRETURN 8000h | ¶Ç¦^ªºÀÉ®×¥¼¿ï¨ú¡u°ßŪ¡v½Æ¿ï®Ø¡A¦Ó¥B¤£¦b¨ü¼g¤J«OÅ@ªº¥Ø¿ý¤¤¡C |
OFN_NOTESTFILECREATE 10000h | ¦pªGÀ³¥Îµ{¦¡±NÀÉ®×Àx¦s¦b create-nonmodify ¦@¥Îºô¸ô¤W¡A«hÀ³¸Ó«ü©w¦¹ºX¼Ð¡F¦¹®É¡Aµ{¦¡®w¤£·|Àˬd¼g¤J«OÅ@¡B§¹¾ãºÏ¤ù¡B¶}±ÒªººÏ¤ùºÏºÐ¾÷ªù©Îºô¸ô«OÅ@¡C |
OFN_NONETWORKBUTTON 20000h | ¤£Åã¥Ü¡uºô¸ô¡v«ö¶s¡C¦ýÁ`ºÞ·®æ¥ª°¼¡u¦ì¸m¦C¡v¡]ì¤å¬O¡uplaces bar¡v¡A¤]½Ķ¦¨¡u±`¥Î¦ì¸m¦C¡v¡^¤¤ªººô¸ô¡A¤´·|Åã¥Ü¡C |
OFN_NOLONGNAMES 40000h | ¹ï©ó·®æªº¹ï¸Ü²°¡A¦¹ºX¼Ð·|¨Ï¥ÎµuÀɦW®æ¦¡¡]8.3 ®æ¦¡¡^¡CÁ`ºÞ·®æ¹ï¸Ü²°·|©¿²¤¦¹ºX¼Ð¡A¤@«ßÅã¥ÜªøÀɦW¡C |
OFN_EXPLORER 80000h | ¨Ï¹ï¸Ü²°±Ä¡uÁ`ºÞ·®æ¡v¡]Explorer-style¡^Åã¥Ü¨äµe±¦p¹Ï¤G¡C³o¬O¹w©wªººX¼Ð¡A¤]´N¬O¤£ºÞ¦³¨S¦³¦b Flags ¤¤«ü©w OPN_EXPLORER ³£·|±Ä¥Î³oºØ·®æ¡C ¥t¤@ºØºÙ¬°Â·®æ¡]old-style¡^¡A¦p¹Ï¥|¡CFlags ¤£§t OPN_EXPLORER¡A¦ý§t¦³ OFN_ALLOWMULTISELECT¡A´N·|¨Ï¥Î·®æ¡C¦³Ãö·®æ¡AÁÙ¦³§ó¦h¸ê°T½Ð°Ñ¾\µù¤@¡C |
OFN_NODEREFERENCELINKS 100000h | «ü¥Ü¹ï¸Ü²°¶Ç¦^©Ò¿ï±¶®|¡].LNK¡^ªº¸ô®|©MÀɮצWÀɮסF¦pªG¥¼«ü©w¦¹È¡A¶Ç¦^ªº¬O±¶®|¬O¯u¹êÀɮתº¸ô®|©MÀɮצW¡C |
OFN_LONGNAMES 200000h | ¦¹ºX¼ÐÅý·®æ¹ï¸Ü²°¨Ï¥ÎªøÀɦW¡FY¥¼³]¦¹ºX¼Ð¡A©Î³]¸m OFN_ALLOWMULTISELECT ºX¼Ð¡A·®æ¹ï¸Ü²°·|¨Ï§t¦³ªÅ®æªºÀɮצW±Ä¥ÎµuÀɮצW¡]8.3 ®æ¦¡¡^¡CÁ`ºÞ·®æ¹ï¸Ü²°·|©¿²¤¦¹ºX¼Ð¡A¨Ã¤@«ßÅã¥ÜªøÀɦW¡C |
OFN_ENABLEINCLUDENOTIFY 400000h | ·í¨Ï¥ÎªÌ¶}±Ò¸ê®Æ§¨®É¡A·|¾ÉP¹ï¸Ü²°±N CDN_INCLUDEITEM ³qª¾½X¶Ç°e¦ÜÄdºIµ{¦¡¡C¹ï¸Ü²°·|°w¹ï·s¶}±Òªº¸ê®Æ§¨¤¤ªº¨CÓ¶µ¥Ø¶Ç°e³qª¾½X¡AÂǥѳo³qª¾½X¡AÀ³¥Îµ{¦¡¥i¥H±±¨î¹ï¸Ü²°¦b²M³æ²°±±¨î¶µ¤¤Åã¥Üþ¨Ç¶µ¥Ø¡C |
OFN_ENABLESIZING 800000h | ³]©w OFN_ENABLESIZING «á¯à°÷¨Ï¥Î·Æ¹«©ÎÁä½L¨Ó½Õ¾ã¹ï¸Ü²°¤j¤p¡C¦ý¬O¨ã¦³¡uÁ`ºÞ·®æ¡vªº¶}±ÒÂÂÀÉ©Î¥t¦s·sÀɹï¸Ü²°¤¹³\½Õ¾ã¹ï¸Ü²°¤j¤p¡A¦Ó¤£½×¬O§_³]©w¤F¦¹ºX¼Ð¡C¥u¦³¦b¦Û¦æ¼¶¼gªº±¾¹_¨ç¦¡©Î¦Ûq½d¥»®É¡A¤~»Ýn¦¹ºX¼Ð¡C·®æ¹ï¸Ü²°¤£¤¹³\½Õ¾ã¤j¤p¡A¤£½×¬O§_³]©w¤F¦¹ºX¼Ð¡C |
OFN_FORCESHOWHIDDEN 10000000 | ±j¨îÅã¥Ü¨t²ÎÀɮשMÁôÂÃÀɮסA±q¦ÓÂл\¨Ï¥ÎªÌ³]©wªº¡uÅã¥Ü©Î¤£Åã¥ÜÁôÂäå¥ó¡v¿ï¶µ¡CµM¦Ó¡A¤£·|Åã¥Ü¦P®É¬°¨t²Î©MÁôÂÃÄݩʪºÀɮסC |
²Ä¤G¤Q³¹´£¹Lªº¼Ð·Ç±±¨î¶µ¯àµo¥X WM_COMMAND °T®§¡A¦ý¦³¨Ç±±¨î¶µ¤£µo¥X WM_COMMAND °T®§¡A¦Ó¬Oµo¥X WM_NOTIFY °T®§¡A¨Ò¦p³q¥Î±±¨î¶µ¡]common controls¡^¥H¤Î¦b¶}±ÒÂÂÀÉ©Î¥t¦s·sÀɳq¥Î¹ï¸Ü²°¤¤ªº¡u»¡©ú¡v«ö¶s´N¬O¦p¦¹¡C
WM_NOTIFY °T®§ªº wParam ¬Oµo¥X WM_NOTIFY °T®§ªº±±¨î¶µÃѧO½X¡]identifier¡^¡AÃѧO½X¨Ã¤£¤@©w¬O°ß¤@ªº¡A©Ò¥HÀ³¥Îµ{¦¡À³¸Ó¨Ï¥Î NMHDR µ²ºcÅ餤ªº hwndFrom ©Î idFrom Äæ¦ì¨ÓÃѧO±±¨î¶µ¡C
WM_NOTIFY °T®§ªº lParam ¬O¤@Óµ²ºcÅ骺¦ì§}¡A¤£¦P±±¨î¶µ¦b lParam ©Ò«ü¦ì§}¤Wªºµ²ºcÅ餣¦P¡A¨Ò¦p²M³æÀ˵ø±±¨î¶µ¡]list view¡^ªºµ²ºcÅé¬O NMLISTVIEW¡A¶}±ÒÂÂÀÉ©Î¥t¦s·sÀɳq¥Î¹ï¸Ü²°¤¤ªº¡u»¡©ú¡v«ö¶sªºµ²ºcÅé¬O OFNOTIFY¡COFNOTIFY ªº¦UÓÄæ¦ì¦p¤U¡G¡]ª`·N¡IOFNOTIFY µ²ºcÅ馳¹ï»ôÈ QWORD¡AWinInc ¦b COMMDLG.INC ¤¤¿òº|¹ï»ôÈ¥²¶·§ó¥¿¤~¯à¥¿½T°õ¦æ¡^
OFNOTIFY STRUCT QWORD hdr NMHDR <> ;NMHDR µ²ºcÅé lpOFN DQWORD ? ;OPENFILENAME µ²ºcÅé¦ì§} pszFile LPSTR ? ;ÀɮצWºÙ¦ì§} OFNOTIFY ENDS
©³¤U»¡©ú OFNOTIFY ªº¦UÄæ¦ì¡G
NMHDR STRUCT hwndFrom HWND ? ;µo¥X WM_NOTIFY °T®§ªº±±¨î¶µ¥N½X idFrom DWORD ? ;µo¥X WM_NOTIFY °T®§ªº±±¨î¶µÃѧO½X code DWORD ? ;³qª¾½X NMHDR ENDS
³qª¾½X | »¡©ú |
NM_CLICK | ¨Ï¥ÎªÌ¦b³q¥Î±±¨î¶µ«ö¤UÃP¶}·Æ¹«¥ªÁä |
NM_DBLCLK | ¨Ï¥ÎªÌ¦b³q¥Î±±¨î¶µ³sÄò¨â¦¸«ö¤UÃP¶}·Æ¹«¥ªÁä |
NM_RCLICK | ¨Ï¥ÎªÌ¦b³q¥Î±±¨î¶µ«ö¤UÃP¶}·Æ¹«¥kÁä |
NM_RDBLCLK | ¨Ï¥ÎªÌ¦b³q¥Î±±¨î¶µ³sÄò¨â¦¸«ö¤UÃP¶}·Æ¹«¥kÁä |
NM_RETURN | ¨Ï¥ÎªÌ¦b³q¥Î±±¨î¶µ¾Ö¦³¿é¤JµJÂI®É¡A«ö¤UÁä½L¤Wªº¡uEnter¡vÁä |
NM_SETFOCUS | ³q¥Î±±¨î¶µÀò±o¿é¤JµJÂI |
NM_KILLFOCUS | ³q¥Î±±¨î¶µ¥¢¥h¿é¤JµJÂI |
NM_OUTOFMEMORY | ¨S¦³¨¬°÷ªº°O¾ÐÅé¾Þ§@³q¥Î±±¨î¶µ |
¦]¬° OFNOTIFY µ²ºcÅé¬O¥Ñ¨t²Î¸g¥Ñ WM_NOTIFY °T®§ªº lParam °Ñ¼Æ«ü©wªº¡A¨Ã«D¥ÑÀ³¥Îµ{¦¡¦Û¦æ©w¸qªº¡A¦s¨ú OFNOTIFY µ²ºcÅé´N·|¤ñ¸û³Â·Ð¡C
³q±`·|¥Î ASSUME °²«ü¥O«Å§i¬YÓ 64 ¦ì¤¸ªº¼È¦s¾¹¹ïÀ³¦¹µ²ºcÅé°_©l¦ì§}¡A¦A±N¦¹¼È¦s¾¹¤§È³]¬° lParam¡A³o¼Ë¸Ó¼È¦s¾¹´N¬Oµ²ºcÅ骺°_©l¦ì§}¡AµM«á´N¯à¥Ñ¤@¯ë¦s¨úµ²ºcÅ骺¤è¦¡¦s¨ú¦UÄæ¦ì¡C¦pªG¤£¶·¦A¦s¨ú¸Óµ²ºcÅé¡A¶·¨ú®ø¦¹¼È¦s¾¹¹ïÀ³ªºµ²ºcÅ骺«Å§i¡C¨Ò¦p©³¤Uªº¨Ò¤l¬O¥H R11 «ü¦V OFNOTIFY µ²ºcÅ骺°_©l¦ì§}¡A°²¦pn¦s¨ú NMHDR ¤¤ªº code ©Î¨ä¥LÄæ¦ì¤]¤£§xÃø¡A¨£¤U±²Ä¤T¦C¡A¹Lµ{¦p¤U¡G
ASSUME r11:PTR OFNOTIFY mov r11,lParam mov eax,[r11].hdr.code ⁝ ASSUME r11:NOTHING
ÄdºI¨ç¦¡ì¤å¬° hook procedure¡A¤]½Ķ¦¨±¾¹_¨ç¦¡¡A¬O¤@ºØÀ³¥Îµ{¦¡©w¸qªº¦^©I¨ç¦¡¡A¥¦¯àºÊµø©Î³B²z¨t²Îµo°e¨ì¹ï¸Ü²°ªº°T®§©M¨Æ¥ó¡A¤]¥Î©ó¦Ûq¹ï¸Ü²°ªº¦æ¬°¡C§ó¸Ô²Óªº»¡¡AÄdºIµ{¦¡»P OPENFILENAME µ²ºcÅ餤¡AlpTemplateName Äæ¦ì©Ò«ü©wªº¤l¹ï¸Ü²°±ªO·f°t«á¡A¥i¥H¦b¡u¶}±ÒÂÂÀÉ¡v©Î¡u¥t¦s·sÀÉ¡v¹ï¸Ü²°²K¥[·sªº±±¨î¶µ¡A¥H·s¼WÃB¥~ªº¥\¯à¡CÄdºI¨ç¦¡ªºì«¬¦p¤U¡A¸òµøµ¡¨ç¦¡©Î¹ï¸Ü²°¨ç¦¡¤@¼Ë¡G
¨ç¦¡¦WºÙ PROC hDlg:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM .if uMsg==°T®§¥Ò ⁝ .elseif uMsg==°T®§¤A ⁝ .else xor rax,rax ;¥¼¸gÄdºI¨ç¦¡³B²z¹Lªº°T®§ªð¦^¹s ret .endif mov rax,1 ;¤w¥ÑÄdºI¨ç¦¡³B²z¹Lªº°T®§ªð¦^¤@ ret ¨ç¦¡¦WºÙ ENDP
n«Ø¥ßÄdºI¨ç¦¡¡A¥²¶·¦b OPENFILENAME µ²ºcÅ骺 Flags Äæ¦ì§t¦³ OFN_ENABLEHOOK¡A¨Ã¥B¦b lpfnHook Äæ¦ì©Ò«ü©wªºÄdºI¨ç¦¡¦ì§}¡A¯Ê¤@¤£¥i¡C
¦pªGÀ³¥Îµ{¦¡«Ø¥ß¤FÁ`ºÞ·®æªº¶}±ÒÂÂÀÉ©Î¥t¦s·sÀɳq¥Î¹ï¸Ü²°¡A¨Ã¥B¤]´£¨Ñ¤FÄdºIµ{¦¡¡A¨º»ò¨t²Î·|¨Ì¾Ú OPENFILENAME ¤¤ lpTemplateName Äæ¦ì©Ò«ü©wªº¹ï¸Ü²°±ªO¡A«Ø¥ß³q¥Î¹ï¸Ü²°ªº¤l¹ï¸Ü²°¡F¦Ó lpfnHook Äæ¦ì©Ò«ü©wªºÄdºI¨ç¦¡¡A´N§@¬°³oÓ¤l¹ï¸Ü²°ªº¹ï¸Ü²°¨ç¦¡¡C°²¦pÀ³¥Îµ{¦¡¥u´£¨Ñ¤FÄdºIµ{¦¡¡A¦ý¨S¦³«ü©w¹ï¸Ü²°±ªO¡A¨º»ò¨t²Î·|¦Û¦æ«Ø¥ß¤@Ó¹w³]ªº¤l¹ï¸Ü²°¡A¦Ó lpfnHook Äæ¦ì©Ò«ü©wªºÄdºI¨ç¦¡¡A´N§@¬°³oÓ¹w³]¤l¹ï¸Ü²°ªº¹ï¸Ü²°¨ç¦¡¡C
ÄdºI¨ç¦¡ªº¦æ¬°»P¹ï¸Ü²°¨ç¦¡¤@¼Ò¤@¼Ë¡C¹ï©óÀ³¥Îµ{¦¡·P¿³½ìªº°T®§¥[¥H³B²z¡A³B²z§¹²¦§â¦^¶Çȳ]¬°¤@ªð¦^¨t²Î¡A§iª¾¨t²Î¤w³B²z¹L¸Ó°T®§¡F¹ï¤£·P¿³½ìªº°T®§¡A§â¦^¶Çȳ]¬°¹sªð¦^¨t²Î¡A§iª¾¨t²Î¨Ã¥¼³B²z¸Ó°T®§¡A¨t²Î·|t³d³B²z¡C
²Ä¤Q¤³¹¤¶²Ð¤F VIEWBMP2¡BVIEWBMP3¡A¥¦Ì³£¬O¥Ñ©R¥O´£¥Ü¦r¤¸¿é¤J¦ì¤¸¹ÏÀɮצWºÙ¡AµM«á¦A§â¦ì¤¸¹ÏÅã¥Ü¦b¤u§@°Ï¤W¡A³o¨Ã¤£²Å¦X²{¥N¤H¨Ï¥Îªº²ßºD¡C³oùؤ¶²Ðªº VIEWBMP4¡A±N§ïÅܳoÓ¬yµ{¡C·í VIEWBMP4 °õ¦æ«á¡A¨Ï¥ÎªÌ¥i¥H¥Ñ¥D¥\¯àªí¿ï¾Ü¡uÀɮסv¡÷¡u¶}±Ò¡v¡]¨£¤U¹Ï¤¡^¡A³o®É·|¼u¥X¡u¶}±ÒÂÂÀÉ¡v³q¥Î¹ï¸Ü²°¡]¨£¤U¹Ï¤»¡^¡C¨Ï¥ÎªÌ¥i©ó¹ï¸Ü²°¤º¬D¿ï·QÆ[¬Ýªº¦ì¤¸¹Ï¡A¤]¥i¤Á´«¨ì§Oªº¥Ø¿ý¿ï¾Ü¨ä¥L¥Ø¿ýªº¦ì¤¸¹Ï¡A
«ö¤U¡u¶}±ÒÂÂÀÉ¡v«ö¶s«á¡A´N¯àÆ[¬Ý¦ì¤¸¹Ï¤F¡C
ª`·N¨ì¤W±¹Ï¤»¤¤ªº¥k¤U¨¤¦³Ó¡u»¡©ú¡v«ö¶s¡A³o¬O¦]¬°¦b©I¥s GetOpenFileName ®É¡A¨ä°Ñ¼Æ OPENFILENAME ªº Flags Äæ¦ì§t¦³ OFN_SHOWHELP ºX¼Ð¡C·í¨Ï¥ÎªÌ«ö¤U³oÓ«ö¶s®É¡A·|²£¥Í¤@Óµøµ¡¡A»¡©ú¦¹µ{¦¡ªº¥\¥Î¡C¥¿¦]¦p¦¹¡A©Ò¥H¥²¶·¦³ÓÄdºI¨ç¦¡³B²z«ö¤U¡u»¡©ú¡v«ö¶sªº°T®§¡A³o¤]³y¦¨ Flags Äæ¦ì»Ýn¦³ OFN_ENABLEHOOK¡A¦P®É lpfnHook Äæ¦ì¥²¶·¬OÄdºI¨ç¦¡¦ì§}¡C
©³¤U¬O VIEWBMP4.EXE.MANIFEST¡G
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20 21 |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
type="win32"
name="AtHome.Wanker.ViewBmp4"
version="1.0.0.0"
processorArchitecture="amd64"
/>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="amd64"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
|
©³¤U¬O VIEWBMP4.RC¡G
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18 19
|
#include "RESOURCE.H"
#define VBMENU 2000
#define IDM_OPEN 2001
#define IDM_QUIT 2002
#define IDM_HELP 2003
VBMENU MENU
BEGIN
POPUP "ÀÉ®×"
BEGIN
MENUITEM "¶}±Ò",IDM_OPEN
MENUITEM "Â÷¶}",IDM_QUIT
END
MENUITEM "»¡©ú",IDM_HELP
END
#define RT_MANIFEST 24
1 RT_MANIFEST MOVEABLE PURE "VIEWBMP4.EXE.MANIFEST"
2004 ICON EYE.ICO |
©³¤U¬O VIEWBMP4.ASM¡G
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 23 24
25 26 27 28
29 30 31 32
33 34 35 36
37 38 39 40
41 42 43 44
45 46 47 48
49 50 51 52
53 54 55 56
57 58 59 60
61 62 63 64
65 66 67 68
69 70 71 72
73 74 75 76
77 78 79 80
81 82 83 84
85 86 87 88
89 90 91 92
93 94 95 96
97 98 99 100
101 102 103 104
105 106 107 108
109 110 111 112
113 114 115 116
117 118 119 120
121 122 123 124
125 126 127 128
129 130 131 132
133 134 135 136
137 138 139 140
141 142 143 144
145 146 147 148
149 150 151 152
153 154 155 156
157 158 159 160
161 162 163 164
165 166 167 168
169 |
OPTION CASEMAP:NONE
OPTION WIN64:3
OPTION LITERALS:ON
_WIN32_WINNT EQU 500h ;¨Ï¥ÎWindows 2000¤Î¨ä¥H«áªºOPENFILENAMEª©¥»
UNICODE EQU 1 ;¨Ï¥ÎUNICODE½s½X¦r¤¸
VBMENU EQU 2000
IDM_OPEN EQU 2001
IDM_QUIT EQU 2002
IDM_HELP EQU 2003
INCLUDE WINDOWS.INC
INCLUDELIB GDI32.LIB
INCLUDELIB KERNEL32.LIB
INCLUDELIB USER32.LIB
INCLUDELIB COMDLG32.LIB
;***************************************************************************************************
.CONST
szClass DW "VIEWBMP",0
szTitle DW 89c0h,770bh,4f4dh,5143h,5716h,0 ;Æ[¬Ý¦ì¤¸¹Ï
szRem DW 89c0h,770bh,42h,4dh,50h,5716h,7247h,6a94h ;Æ[¬ÝBMP¹Ï¤ùÀÉ
DW 7684h,7c21h,55aeh,7a0bh,5f0fh,3002h,0 ;ªºÂ²³æµ{¦¡¡C
szSure DW 78bah,5b9ah,9000h,51fah,55ceh,0ff1fh,0 ;½T©w°h¥X¶Ü¡H
szAsk DW 8a62h,554fh,0 ;¸ß°Ý
szNote DW 8aaah,660eh,0 ;»¡©ú
szExt DW 2ah,2eh,62h,6dh,70h,0 ;"*.bmp",0
;©³¤Uªº¿z¿ï¦r¦ê¬O¡u"¦ì¤¸¹Ï(*.bmp)",0,"*.bmp",0,"©Ò¦³ÀÉ®×(*.*)",0,"*.*",0,0¡v
szFiltr DW 4f4dh,5143h,5716h,"(*.bmp)",0,"*.bmp",0,6240h,6709h,6a94h,6848h,"(*.*)",0,"*.*",0,0
;***************************************************************************************************
.DATA
hInst DQ ?
ofn OPENFILENAME <>
szFile DW 256 DUP (0) ;Àx¦s¦ÛGetOpenFileNameªð¦^«áªº§¹¾ãÀɮצWºÙ
;***************************************************************************************************
.CODE
;---------------------------------------------------------------------------------------------------
HookPrc PROC hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
.if uMsg==WM_NOTIFY
ASSUME r11:PTR OFNOTIFY
mov r11,lParam
mov eax,[r11].hdr.code
.if eax==CDN_HELP
;³B²z¨Ï¥ÎªÌ«ö¤U¡u»¡©ú¡v«ö¶s
invoke MessageBox,hWnd,OFFSET szRem,OFFSET szNote,MB_OK or MB_ICONINFORMATION
.endif
ASSUME r11:NOTHING
.else
xor rax,rax ;¥¼³B²zªº°T®§¡A¦^¶Çȳ]¬°¹s
ret
.endif
mov rax,1 ;¤w³B²zªº°T®§¡A¦^¶Çȳ]¬°¤@
ret
HookPrc ENDP
;---------------------------------------------------------------------------------------------------
WndProc PROC hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL hBitmap:HBITMAP,rcClnt:RECT,bitmap:BITMAP,hDC:HDC,hdcMem:HDC
.if uMsg==WM_COMMAND
.if r8w==IDM_OPEN
;«Ø¥ß¶}±ÒÂÂÀɹï¸Ü²°¡A¨Ñ¨Ï¥ÎªÌ¿ï¾ÜÀÉ®×
mov r11,hWnd
mov r10,hInst
lea r9,szFiltr
lea r8,szFile
lea rdx,szExt
mov ofn.lStructSize,SIZEOF ofn
mov ofn.hwndOwner,r11
mov ofn.hInstance,r10
mov ofn.lpstrFilter,r9
mov ofn.lpstrCustomFilter,0
mov ofn.nFilterIndex,1
mov ofn.lpstrFile,r8
mov ofn.nMaxFile,LENGTHOF szFile
mov ofn.lpstrFileTitle,0
mov ofn.nMaxFileTitle,0
mov ofn.lpstrInitialDir,0
mov ofn.lpstrTitle,0
mov ofn.Flags,OFN_SHOWHELP or OFN_EXPLORER or OFN_ENABLEHOOK or OFN_HIDEREADONLY
mov ofn.lpstrDefExt,rdx
lea r10,HookPrc
mov ofn.lCustData,0
mov ofn.lpfnHook,r10
mov ofn.lpTemplateName,0
mov ofn.pvReserved,0
mov ofn.dwReserved,0
mov ofn.FlagsEx,0
invoke GetOpenFileName,ADDR ofn
mov hBitmap,RV(LoadImage,hInst,ADDR szFile,IMAGE_BITMAP,0,0,LR_LOADFROMFILE)
;¦pªGµLªk¸ü¤J¨Ï¥ÎªÌ¿ï¾Üªº¦ì¤¸¹Ï¡ARAX·|µ¥©ó¹s¡A¤£°µ³B²zªð¦^
or rax,rax
jz rtn
invoke GetObject,hBitmap,SIZEOF BITMAP,ADDR bitmap
mov r10d,bitmap.bmWidth ;R10D¡×¦ì¤¸¹Ï¼e«×
mov r11d,bitmap.bmHeight ;R11D¡×¦ì¤¸¹Ï°ª«×
;pºâ¯à®e¯Ç¾ã±i¦ì¤¸¹Ïªºµøµ¡»Ýn³Ì¤p¼e«×»P°ª«×
mov rcClnt.left,0
mov rcClnt.top,0
mov rcClnt.right,r10d
mov rcClnt.bottom,r11d
invoke AdjustWindowRect,ADDR rcClnt,WS_CAPTION or WS_SYSMENU,0
mov r10d,rcClnt.right
mov r11d,rcClnt.bottom
sub r10d,rcClnt.left ;R10D¡×pºâ§¹¦¨«áªºµøµ¡¼e«×
sub r11d,rcClnt.top ;R11D¡×pºâ§¹¦¨«áªºµøµ¡°ª«×
invoke MoveWindow,hWnd,50,50,r10d,r11d,0
;Åã¥Ü¨Ï¥ÎªÌ©Ò¿ï¾Üªº¦ì¤¸¹Ï
mov hDC,RV(GetDC,hWnd)
mov hdcMem,RV(CreateCompatibleDC,hDC)
invoke SelectObject,hdcMem,hBitmap
invoke BitBlt,hDC,0,0,bitmap.bmWidth,bitmap.bmHeight,hdcMem,0,0,SRCCOPY
invoke DeleteDC,hdcMem
invoke ReleaseDC,hWnd,hDC
.elseif r8w==IDM_HELP
invoke MessageBox,hWnd,OFFSET szRem,OFFSET szNote,MB_OK or MB_ICONINFORMATION
.elseif r8w==IDM_QUIT
invoke SendMessage,hWnd,WM_CLOSE,0,0
.endif
.elseif uMsg==WM_DESTROY
invoke PostQuitMessage,0
.elseif uMsg==WM_CLOSE
close: cmp RV(MessageBox,0,ADDR szSure,ADDR szAsk,MB_YESNO or MB_ICONQUESTION),IDYES
jne rtn
invoke DestroyWindow,hWnd
.elseif uMsg==WM_DESTROY
invoke PostQuitMessage,0
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
rtn: xor eax,eax
ret
WndProc ENDP
;---------------------------------------------------------------------------------------------------
main PROC
LOCAL hwnd:HWND,msg:MSG,wc:WNDCLASSEX
lea rdx,WndProc
mov hInst,RV(GetModuleHandle,0)
mov wc.cbSize,SIZEOF WNDCLASSEX
mov wc.style,CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc,rdx
mov wc.cbClsExtra,0
mov wc.cbWndExtra,0
mov wc.hInstance,rax
mov wc.hIcon,RV(LoadIcon,hInst,2004)
mov wc.hIconSm,rax
mov wc.hCursor,RV(LoadCursor,NULL,IDC_ARROW)
mov wc.hbrBackground,COLOR_WINDOW+1
mov wc.lpszMenuName,VBMENU
lea rdx,szClass
mov wc.lpszClassName,rdx
invoke RegisterClassEx,ADDR wc
mov hwnd,RV(CreateWindowEx,0,ADDR szClass,OFFSET szTitle,WS_OVERLAPPEDWINDOW,\
50,50,400,200,0,0,hInst,0)
invoke ShowWindow,hwnd,SW_SHOWNORMAL
invoke UpdateWindow,hwnd
.while TRUE
invoke GetMessage,ADDR msg,0,0,0
.break .if rax==0
invoke TranslateMessage,ADDR msg
invoke DispatchMessage,ADDR msg
.endw
invoke ExitProcess,0
main ENDP
;***************************************************************************************************
END main |
§â EYE.ICO¡BVIEWBMP4.EXE.MANIFEST¡BVIEWBMP4.RC¡BVIEWBMP4.ASM ¥|ÓÀɮשñ¦b¦P¤@¤l¥Ø¿ý¡]¨Ò¦p¡uE:\HomePage\SOURCE\Win64\VIEWBMP\¡v¡^¡A¶}±Ò¡u©R¥O´£¥Ü¦r¤¸¡v¡A¿é¤J¤U±«ü¥O»s§@ VIEWBMP4.EXE¡G
Microsoft Windows [ª©¥» 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\wanker>uasm [Enter] ¡÷°õ¦æ UASM.BAT §å¦¸ÀÉ¡A³]©w²ÕĶ¤Î³sµ²Àô¹Ò¡A¬Ù¤F³\¦h¥´¦r¿é¤J C:\Users\wanker>SET INCLUDE=C:\UASM\Include C:\Users\wanker>SET LIB=C:\UASM\lib64 C:\Users\wanker>SET PATH=C:\UASM;C:\UASM\bin64;C:\Windows\system32;C:\Windows;C: \Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Fi les (x86)\UltraEdit-32 C:\Users\wanker>E: E:\>CD E:\HOMEPAGE\SOURCE\WIN64 LINK=/SUBSYSTEM:WINDOWS /DEBUG ¡÷¨ì¦¹ UASM.BAT ¤w°õ¦æ§¹²¦ E:\HomePage\SOURCE\Win64>cd VIEWBMP [Enter] ¡÷³]©w VIEWBMP4.ASM ©Ò¦b¤l¥Ø¿ý¬°·í«e¥Ø¿ý E:\HomePage\SOURCE\Win64\VIEWBMP>uasm64 -win64 VIEWBMP4.ASM [Enter] ¡÷²ÕĶ UASM v2.56, Oct 27 2022, Masm-compatible assembler. Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved. Source code is available under the Sybase Open Watcom Public License. VIEWBMP4.ASM: 169 lines, 3 passes, 121 ms, 0 warnings, 0 errors ¡÷¨S¦³¿ù»~¡A¦¨¥\²ÕĶ§¹¦¨ E:\HomePage\SOURCE\Win64\VIEWBMP>rc VIEWBMP4.RC [Enter] ¡÷½sĶ¸ê·½´yzÀÉ Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384 Copyright (C) Microsoft Corporation. All rights reserved. ¡÷¨S¦³°T®§¡A¥Nªí½sĶ¦¨¥\¨Ã¥Í¦¨ VIEWBMP4.RES ¸ê·½ÀÉ E:\HomePage\SOURCE\Win64\VIEWBMP>link VIEWBMP4.OBJ VIEWBMP4.RES [Enter] ¡÷³sµ² Microsoft (R) Incremental Linker Version 14.25.28614.0 Copyright (C) Microsoft Corporation. All rights reserved. /SUBSYSTEM:WINDOWS /DEBUG ¡÷¨S¦³°T®§¡A¥Nªí VIEWBMP4.EXE ¦¨¥\»s§@¦n¤F E:\HomePage\SOURCE\Win64\VIEWBMP>
¦p±ý°õ¦æ VIEWBMP4.EXE¡A¥u¶·¦b©R¥O´£¥Ü¦r¤¸¿é¤J¡uVIEWBMP4¡v¦A«ö¤U¡uENTER¡vÁä´N¥i¥H¨£¨ì°õ¦æµe±¡CVIEWBMP4 ©Ò»Ýì²z¡A¦b«e±³£¤w±Ôz¹L¤F¡A³oùØ´N¤£¦h»¡¤F¡C
¡u·®æ¡vªº¹ï¸Ü²°º¦¸¥X²{©ó Windows 3.1 ®É´Áªº¡u¶}±ÒÂÂÀÉ¡v»P¡u¥t¦s·sÀÉ¡v¹ï¸Ü²°¡A³oºØ¹ï¸Ü²°¥~Æ[¦p¤U¹Ï¡G ¨ì¤F Windows 95 µoªí¤§«á¡A¤~¦³¤F¡uÁ`ºÞ·®æ¡v¡C¦b¥~Æ[¤W¡A³o¨âºØ·®æ³Ì¤jªº®t§O¦b©óÁ`ºÞ·®æ¥ª°¼¦h¤F¦ì¸m¦C¡]places bar¡A¤]½Ķ¦¨¡u±`¥Î¦ì¸m¦C¡v¡A¨£¹Ï¤Gºñ¦â®Ø¡^¡A°£¦¹¤§¥~Á`ºÞ·®æÁÙ¦³³\¦h¯àÅý¨Ï¥ÎªÌ§ó§Ö³tªº¿ï¾Ü±`¥Î¨ìªº¸ê®Æ§¨¡C¡]°Ñ¦Ò¹Ï¤@¤Î¹Ï¤G¡^
°£¤F¥~Æ[¤£¦P¤§¥~¡A³B²z³o¨âºØ·®æªºµ{¦¡½X¤]¤£¦P¡A³o¤j·§¬O¦]¬°¬°¤F¬Û®e©Ê¡C¦b Windows 3.1 ªº®É¥NÁÙ¤£¤ä´©ªøÀɦW¡A©Ò¥H±Ä¥Î·®æªº¹ï¸Ü²°¡A·|©I¥s¬° Windows 3.1 ©Ò¼¶¼gªºµ{¦¡½X¡C³o¨âºØ·®æªº¹ï¸Ü²°ÁÙ¦³³\¦h¤£¦P¤§³B¡A¾ã²z¦p¤Uªí¡G
¥\¯à | ·®æ | Á`ºÞ·®æ |
ªøÀɮצW¤ä´© | ¤£¤ä´© | ¤ä´© |
¬O§_¥i½Õ¾ã¹ï¸Ü²°¤j¤p | §_ | ¬O |
¦h¿ïÀÉ®×®ÉÀɦW¤À¹j²Å¸¹ | ªÅ¥Õ | ªÅ¦r¤¸ |
¦Û©w¸q¹ï¸Ü²°±ªO | §¹¥þ¨ú¥N²{¦³¹ï¸Ü²° | ´O¤J¨ì²{¦³¹ï¸Ü²° |
¨º»ò¨t²Î¦p¦ó¨M©w¹ï¸Ü²°¨Ï¥Î·®æÁÙ¬OÁ`ºÞ·®æ¡H¥¦¥Ñ©³¤U¤TÂI¨M©w¡G
¥Ñ¥H¤W¬Ý¨Ó¡A¦pªGÀ³¥Îµ{¦¡»ÝnÄdºI¨ç¦¡©Î¦Ûq¹ï¸Ü²°±ªO¡A©Î»Ýn¬D¿ï¦hÓÀɮ׮ɡA¦P®É¤Sn¨Ï¥ÎÁ`ºÞ·®æ¡A¤~»Ýn³]¸m OFN_EXPLORER ºX¼Ð¡A§_«h OFN_EXPLORER ºX¼Ð¦¡¥i¥H¬Ù²¤ªº¡C
¦pªGÀ³¥Îµ{¦¡n¨Ï¥Î·®æ¡A´N±o¬Ù²¤ OFN_EXPLORER¡A¨Ã´£¦Ûq¹ï¸Ü²°±ªO©ÎÄdºI¨ç¦¡¡F¦pªG¬Jn¨Ï¥Î·®æ¡A¤S¤£´£¨Ñ¦Ûq¹ï¸Ü²°±ªO¡A¨º»ò¥i¥H´£¨Ñ¤@Ó©l²×ªð¦^ FALSE ªºÄdºI¨ç¦¡§Y¥i¡C
¦Û¥Á°ê 74 ¦~¡A·L³nµoªí Winodws 1.0 ¤§«á¶}±Ò Windows §@·~¨t²Îªº¶Àª÷®É¥N¡A¦Ó«áÀHµÛ¨Ï¥ÎªÌ¼W¦h»P®É¥Nºt¶i¡A·L³n°w¹ï¤£¦P¥Î¤á¶i¦Óµo®i¥X³\¦hª©¥»¡C¦pªG¤£¦Ò¼{¦æ°Ê¸Ë¸mªº Windows CE¡AWindows ºØÃþ¤jP¥i¤À¬°¤TºØ¡G
Windows ¦WºÙ | 95 | 98 | 98 SE | Me |
Windows 95 ®Ö¤ßª©¥» | 4.00.950 | 4.10.1998 | 4.10.2222 | 4.90.3000 |
Windows ¦WºÙ | 3.1 | 3.5 | 3.51 | 4.0 | 2000 | XP | Vista | 7 | 8 | 8.1 | 10 | 11 |
NT ®Ö¤ßª©¥» | 3.1 | 3.5 | 3.51 | 4.0 | 5.0 | 5.1 | 6.0 | 6.1 | 6.2 | 6.3 | 10.0.19045 | 10.0.26100 |
¥Ñ¤Wªí¨Ó¬Ý¡A¦b Windows 2000 ©Î¤§«áªºª©¥»¤~¤ä´© pvReserved¡BdwReserved¡BFlagsEx ³o¤TÓÄæ¦ì¡FWindows 95/98/98SE/Me ³£¤£¤ä´©¡C