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
| .586p
.mmx
.model flat, stdcall
option casemap :none
Include \masm32\include\windows.inc
Include \masm32\include\user32.inc
Include \masm32\include\kernel32.inc
Includelib \masm32\lib\user32.lib
Includelib \masm32\lib\kernel32.lib
DialogProc PROTO hwnd:dword,message:dword,wParam:dword,lParam:dword
.const
BTN_TIME equ 1001
IDC_TIME equ 1002
.data
format db "%x" ,0
time byte 20 dup (0)
buffertimeconv byte 20 dup (0)
.code
DialogProc Proc hwnd:dword,message:dword,wParam:dword,lParam:dword
debut:
pushad
mov eax,hwnd
.IF message==WM_COMMAND
mov eax,wParam
.IF ax==BTN_TIME
call deb
INVOKE SetDlgItemTextA,hwnd,IDC_TIME, addr time
.ENDIF
.ELSE
popad
xor eax,eax
ret
.ENDIF
popad
xor eax,eax
ret
DialogProc endp
deb:
pushad
invoke GetSystemTime, addr time
jmp first
conv:
pushad
INVOKE wsprintf, addr buffertimeconv, addr format, buffertimeconv
popad
second:
mov byte ptr ds:[ecx], al
call conv
mov ax, word ptr ds:[buffertimeconv]
.IF ah==0
mov al, 30h
.ENDIF
mov word ptr ds:[buffertimeconv], 0
mov word ptr ds:[edx], ax
.IF ebx==6
mov byte ptr ds:[edx+ebx+2], 0
.ELSE
mov byte ptr ds:[edx+ebx+2], 58
.ENDIF
ret
first:
xor eax,eax
sub esi, esi
mov ebx, esi
mov ecx, offset buffertimeconv
mov edx, offset time
mov al, byte ptr ds:[edx+8]
call second
add ebx, 3
mov al, byte ptr ds:[edx+10]
call second
add ebx, 3
mov al, byte ptr ds:[edx+12]
call second
popad
ret
END |
Partager