|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
.386
.model flat, stdcall
option casemap :none
include Count.inc
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_Counter proc uses ebx esi edi _lParam
or dwOption,F_COUNTING
and dwOption,not (F_STOP or F_PAUSE)
invoke SetWindowText,hWinCount,addr szStop
invoke EnableWindow,hWinPause,TRUE
xor ebx,ebx
.while ! (dwOption & F_STOP)
.if !(dwOption & F_PAUSE)
inc ebx
invoke SetDlgItemInt,hWinMain,IDC_EDT2,ebx,FALSE
.endif
.endw
invoke SetWindowText,hWinCount,addr szStart
invoke EnableWindow,hWinPause,FALSE
and dwOption,not (F_COUNTING or F_STOP or F_PAUSE)
ret
_Counter endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ProcDlgMain proc uses ebx edi esi hWnd,wMsg,wParam,lParam
local @dwThreadID
LOCAL @dwOptionb
mov eax,wMsg
;********************************************************************
.if eax == WM_COMMAND
mov eax,wParam
.if ax == IDC_BTN1 ;第一次按下这个按钮 红色字IF结果为假,执行_COUNTER过程,过程执行完毕dwOption的值为4,在次进入下面红字IF判断结果为真,接着执行or dwOption,F_STOP但是我不明白为什么执行了下面绿字OR语句还执行了上面蓝色字的部分,它是怎么调用的?求大神指导
.if dwOption & F_COUNTING
or dwOption,F_STOP
.else
invoke CreateThread,NULL,0,offset _Counter,NULL,\
NULL,addr @dwThreadID
invoke CloseHandle,eax
.endif
.elseif ax == IDC_BTN2
xor dwOption,F_PAUSE
.endif
;********************************************************************
.elseif eax == WM_CLOSE
invoke EndDialog,hWnd,NULL
;********************************************************************
.elseif eax == WM_INITDIALOG
push hWnd
pop hWinMain
invoke GetDlgItem,hWnd,IDC_BTN1
mov hWinCount,eax
invoke GetDlgItem,hWnd,IDC_BTN2
mov hWinPause,eax
;********************************************************************
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
_ProcDlgMain endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,eax,IDD_DIALOG1,NULL,offset _ProcDlgMain,NULL
invoke ExitProcess,NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end start
end startinclude windows.inc
include kernel32.inc
include user32.inc
include Comctl32.inc
include shell32.inc
includelib kernel32.lib
includelib user32.lib
includelib Comctl32.lib
includelib shell32.lib
DlgProc PROTO :HWND,:UINT,:WPARAM,:LPARAM
.data
dwOption dd 0
.const
;Count.dlg
IDD_DIALOG1 equ 101
IDC_BTN1 equ 1001
IDC_BTN2 equ 1002
IDC_EDT2 equ 1003
IDC_STC1 equ 1004
F_STOP equ 0002h ;停止标志
F_COUNTING equ 0004h ;计算标志
F_PAUSE equ 0001h ;暂停标志
szStop db '停止计数',0
szStart db '计数',0
szing db "这里是PROC",0
szing1 db "PROC循环后",0
;& equ and
;#########################################################################
.data?
hInstance dd ?
hWinMain dd ?
hWinCount dd ?
hWinPause dd ?
|
|