#define IDD_DLG 1000
#define IDD_C 1001
#define IDD_D 1002
#define IDD_E 1003
#define IDD_F 1004
#define IDD_OK 1005
#define IDD_CLOSE 1006
#define ICO_MAIN 1007
IDD_DLG DIALOGEX 6,6,135,52
CAPTION "默认安装设置器"
FONT 8,"MS Sans Serif",0,0
STYLE 0x10CF0000
BEGIN
CONTROL "C盘",IDD_C,"Button",0x50010009,10,11,30,11
CONTROL "D盘",IDD_D,"Button",0x50010009,10,31,30,11
CONTROL "E盘",IDD_E,"Button",0x50010009,50,11,30,11
CONTROL "F盘",IDD_F,"Button",0x50010009,50,31,30,11
CONTROL "确定",IDD_OK,"Button",0x50010000,92,11,34,13
CONTROL "关闭",IDD_CLOSE,"Button",0x50010000,92,31,36,13
END
ICO_MAIN ICON DISCARDABLE "Main.ico"
.386
.model flat, stdcall
option casemap :none
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
include advapi32.inc
includelib advapi32.lib
include ole32.inc
includelib ole32.lib
includelib shell32.lib
include shell32.inc
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
IDD_DLG equ 1000h
IDD_C equ 1001h
IDD_D equ 1002h
IDD_E equ 1003h
IDD_F equ 1004
IDD_OK equ 1005
IDD_CLOSE equ 1006
ICO_MAIN equ 1007
.data?
hInstance dd ?
.const
szRegKey db 'SOFTWARE\Microsoft\Windows\CurrentVersion',0
szRegValue db 'ProgramFilesDir',0
szStr1 db 'C:\Program Files',0
szStr2 db 'D:\Program Files',0
szStr3 db 'E:\Program Files',0
szStr4 db 'F:\Program Files',0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.code
_ProcDlgMain proc uses ebx edi esi hWnd,wMsg,wParam,lParam
LOCAL @save
mov eax,wMsg
.if eax == WM_CLOSE
invoke EndDialog,hWnd,NULL
.elseif eax == WM_INITDIALOG
invoke LoadIcon,hInstance,ICO_MAIN
invoke SendMessage,hWnd,WM_SETICON,ICON_BIG,eax
.elseif eax == WM_COMMAND
mov eax,wParam
.if ax == IDD_C
invoke RegCreateKey,HKEY_LOCAL_MACHINE,addr szRegKey,addr @save
invoke RegSetValueEx,@save,addr szRegValue,NULL,REG_SZ,addr szStr1,sizeof szStr1
invoke RegCloseKey,@save
.elseif ax == IDD_D
invoke RegCreateKey,HKEY_LOCAL_MACHINE,addr szRegKey,addr @save
invoke RegSetValueEx,@save,addr szRegValue,NULL,REG_SZ,addr szStr2,sizeof szStr2
invoke RegCloseKey,@save
.elseif ax == IDD_E
invoke RegCreateKey,HKEY_LOCAL_MACHINE,addr szRegKey,addr @save
invoke RegSetValueEx,@save,addr szRegValue,NULL,REG_SZ,addr szStr3,sizeof szStr3
invoke RegCloseKey,@save
.elseif ax == IDD_E
invoke RegCreateKey,HKEY_LOCAL_MACHINE,addr szRegKey,addr @save
invoke RegSetValueEx,@save,addr szRegValue,NULL,REG_SZ,addr szStr3,sizeof szStr3
invoke RegCloseKey,@save
.endif
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
_ProcDlgMain endp
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,hInstance,IDD_DLG,NULL,offset _ProcDlgMain,0
invoke ExitProcess,NULL
end start
编译也没问题,可程序就是运行不起来。大家帮忙看看是为什么
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课