📄 fill.asm
字号:
;填充对话框
_FillProc proto:DWORD ,:DWORD ,:DWORD ,:DWORD
_DoFill proto:DWORD
.code
_FillProc proc uses esi edi @hDlg,uMsg,wParam,lParam
local @szBuf[255]:BYTE
mov eax,uMsg
.if eax==WM_INITDIALOG
;初始化对话框
invoke SetDlgItemInt,@hDlg,1006,0,0
invoke SetDlgItemInt,@hDlg,1007,0,0
__senddlgmessage 1000,BM_SETCHECK ,1
.elseif eax==WM_COMMAND
mov eax,wParam
.if ax==IDOK
invoke _DoFill,@hDlg
.endif
.elseif eax==WM_CLOSE
invoke ShowWindow,@hDlg,SW_HIDE
.else
xor eax,eax
ret
.endif
mov eax,TRUE
ret
_FillProc endp
;-------------------------------------
_DoFill proc @hDlg
pushad
invoke _GetInt ,@hDlg,1006 ;填充值1
mov bl,al
invoke _GetInt ,@hDlg,1007 ;填充值2
mov bh,al
mov esi,__add2(lpMemFile,dwBlockStart)
mov edi,__add2(lpMemFile,dwBlockEnd)
mov cl,bl
or FLAG_ALL,FLAG_FILECHANGE
mov eax,edi
sub eax,esi
inc eax
.if !isBlockSelMode
invoke _PushUndo,esi,UNDO_REPLACE,eax,NULL
.endif
.while esi<=edi
.if !isBlockSelMode
mov [esi],bl
inc bl
.else
invoke _InBlock,esi,TRUE
.if eax
invoke _PushUndo,esi,UNDO_INPUT,NULL ,NULL
mov [esi],bl
inc bl
.endif
.endif
.if bl>bh
mov bl,cl
.endif
inc esi
.endw
call _ReDraw
popad
invoke SendMessage,@hDlg,WM_CLOSE ,NULL ,NULL
ret
_DoFill endp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -