01 .386
02 .model flat, stdcall ;32 bit memory model
03 option casemap :none ;case sensitive
04 include XXXXXXXXXXc
05 include XXXXXXXXXXXc
06 include XXXXXXXXXc
07 includelib XXXXXXXXXXXb
08 includelib XXXXXXXXXb
09
10 DlgProc PROTO :HWND,:UINT,:WPARAM,[s:10]PARAM
11
12 .data?
13 hInstance dd ?
14 hTimer dd ?
15
16 .code
17 DllEntry proc _hInstance,_dwReason,_dwReserved
18 .if _dwReason==DLL_PROCESS_ATTACH
19 invoke GetModuleHandle,NULL
20 push _hInstance
21 pop hInstance
22 invoke DialogBoxParam,hInstance,101,NULL,addr DlgProc,NULL
23 .endif
24 mov eax,TRUE
25 ret
26 DllEntry endp
27 DlgProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam[s:10]PARAM
28
29 mov eax,uMsg
30 .if eax==WM_INITDIALOG ;初始化,设定1秒的计时器
31 invoke SetTimer,hWin,1,1000,NULL
32 mov hTimer,eax
33 .elseif eax==WM_CLOSE
34 invoke EndDialog,hWin,NULL
35 .elseif eax==WM_TIMER ;时间到,取消计时器,关闭对话框,返回 DllEntry
36 invoke KillTimer,hTimer,1
37 invoke EndDialog,hWin,NULL
38 .else
39 mov eax,FALSE
40 ret
41 .endif
42 mov eax,TRUE
43 ret
44 DlgProc endp
45 End DllEntry