📄 raresed.asm
字号:
.if eax
mov eax,[eax].DIALOG.ntype
.if eax
mov eax,1
.endif
.endif
.elseif hMultiSel
mov eax,2
.endif
jmp Ex
.elseif eax==DEM_ALIGNSIZE
mov eax,lParam
invoke AlignSizeCtl,lParam
jmp Ex
.elseif eax==DEM_GETMODIFY
invoke GetWindowLong,hWin,DEWM_MEMORY
.if eax
mov eax,[eax].DLGHEAD.changed
.endif
jmp Ex
.elseif eax==DEM_SETMODIFY
mov eax,wParam
.if eax
mov eax,TRUE
.endif
invoke SetChanged,eax,hWin
invoke InvalidateRect,hWin,NULL,TRUE
jmp Ex
.elseif eax==DEM_COMPACT
invoke CompactDialog,hWin
jmp Ex
.elseif eax==DEM_EXPORTTORC
invoke GetWindowLong,hWin,DEWM_MEMORY
invoke ExportDialog,eax
jmp Ex
.elseif eax==DEM_SETPOSSTATUS
mov eax,lParam
mov nStatus,eax
mov eax,wParam
mov hStatus,eax
jmp Ex
.elseif eax==DEM_SETGRIDSIZE
mov edx,wParam
movzx eax,dx
shr edx,16
mov Gridcx,eax
mov Gridcy,edx
mov eax,lParam
mov Gridc,eax
invoke CreateGridBrush
invoke GetWindowLong,hWin,DEWM_DIALOG
.if eax
invoke InvalidateRect,eax,NULL,TRUE
.endif
jmp Ex
.elseif eax==DEM_ADDCONTROL
invoke AddCustomControl,lParam
jmp Ex
.elseif eax==MEM_OPEN
invoke CreateMnu,hWin,lParam
jmp Ex
.elseif eax==WM_USER+9999
mov fEditMode,TRUE
; invoke CreateDlg,hWin,0
xor eax,eax
jmp Ex
.elseif eax==WM_STYLECHANGED
.if wParam==GWL_STYLE
mov edx,lParam
mov eax,[edx].STYLESTRUCT.styleNew
mov edx,eax
and eax,1
mov fGrid,eax
shr edx,1
mov eax,edx
and eax,1
mov fSnapToGrid,eax
shr edx,1
mov eax,edx
and eax,1
mov fShowSizePos,eax
invoke GetWindowLong,hWin,DEWM_DIALOG
.if eax
invoke InvalidateRect,eax,NULL,TRUE
.endif
.endif
.elseif eax==WM_DESTROY
invoke GetWindowLong,hWin,DEWM_MEMORY
.if eax
push esi
mov esi,eax
.if !fEditMode
invoke DestroySizeingRect
mov eax,[esi+sizeof DLGHEAD].DIALOG.hwnd
.if eax
invoke DestroyWindow,eax
.endif
.endif
invoke SetWindowLong,hWin,DEWM_MEMORY,0
invoke SetWindowLong,hWin,DEWM_DIALOG,0
;Freed by project
;invoke GlobalUnlock,esi
;invoke GlobalFree,esi
pop esi
.endif
.elseif eax==WM_KEYDOWN
.if hReSize || hMultiSel
invoke GetKeyState,VK_CONTROL
and eax,80h
push eax
invoke GetKeyState,VK_SHIFT
and eax,80h
mov edx,eax
pop eax
.if !eax && !edx
.if wParam==VK_DELETE
invoke DeleteCtl
.elseif wParam==VK_PGDN
.if hReSize
invoke GetWindowLong,hReSize,GWL_USERDATA
.if eax
mov edx,[eax].DIALOG.tab
mov eax,[eax].DIALOG.hwnd
inc edx
invoke SetNewTab,eax,edx
invoke UpdateCtl,hReSize
.endif
.endif
.elseif wParam==VK_PGUP
.if hReSize
invoke GetWindowLong,hReSize,GWL_USERDATA
.if eax
mov edx,[eax].DIALOG.tab
mov eax,[eax].DIALOG.hwnd
.if edx
dec edx
invoke SetNewTab,eax,edx
invoke UpdateCtl,hReSize
.endif
.endif
.endif
.endif
.elseif !edx && eax
.if wParam==VK_V
invoke PasteCtl
.elseif wParam==VK_C
invoke CopyCtl
invoke NotifyParent
.elseif wParam==VK_X
invoke CopyCtl
invoke DeleteCtl
.elseif wParam==VK_Z
invoke UndoCtl
.endif
.endif
.endif
.if hReSize
.if !eax && !edx
.if wParam==VK_TAB || wParam==VK_RIGHT || wParam==VK_DOWN
invoke GetWindowLong,hReSize,GWL_USERDATA
.if eax
push esi
mov esi,eax
mov eax,(DIALOG ptr [esi]).ntype
.if eax
mov eax,(DIALOG ptr [esi]).tab
inc eax
.endif
push eax
invoke GetWindowLong,hWin,DEWM_MEMORY
pop edx
invoke FindTab,edx,eax
.if !eax
invoke GetWindowLong,hWin,DEWM_MEMORY
invoke FindTab,0,eax
.endif
.if eax
invoke SizeingRect,eax,FALSE
.endif
pop esi
.endif
.elseif wParam==VK_LEFT || wParam==VK_UP
invoke GetWindowLong,hReSize,GWL_USERDATA
.if eax
push esi
mov esi,eax
mov eax,(DIALOG ptr [esi]).tab
dec eax
push eax
invoke GetWindowLong,hWin,DEWM_MEMORY
pop edx
invoke FindTab,edx,eax
.if !eax
invoke GetFreeTab
.if eax
dec eax
push eax
invoke GetWindowLong,hWin,DEWM_MEMORY
pop edx
invoke FindTab,edx,eax
.endif
.endif
.if eax
invoke SizeingRect,eax,FALSE
.endif
pop esi
.endif
.elseif wParam==VK_RETURN
invoke SetFocus,hPrpLstDlg
invoke SendMessage,hPrpLstDlg,WM_CHAR,VK_RETURN,0
.endif
.elseif !edx && eax
invoke GetWindowLong,hReSize,GWL_USERDATA
.if eax
push esi
mov esi,eax
mov eax,wParam
.if eax==VK_LEFT
.if fSnapToGrid
mov eax,(DIALOG ptr [esi]).x
sub eax,Gridcx
xor edx,edx
idiv Gridcx
imul Gridcx
mov (DIALOG ptr [esi]).x,eax
.else
dec (DIALOG ptr [esi]).x
.endif
invoke UpdateCtl,hReSize
.elseif eax==VK_RIGHT
.if fSnapToGrid
mov eax,(DIALOG ptr [esi]).x
add eax,Gridcx
xor edx,edx
idiv Gridcx
imul Gridcx
mov (DIALOG ptr [esi]).x,eax
.else
inc (DIALOG ptr [esi]).x
.endif
invoke UpdateCtl,hReSize
.elseif eax==VK_UP
.if fSnapToGrid
mov eax,(DIALOG ptr [esi]).y
sub eax,Gridcy
xor edx,edx
idiv Gridcy
imul Gridcy
mov (DIALOG ptr [esi]).y,eax
.else
dec (DIALOG ptr [esi]).y
.endif
invoke UpdateCtl,hReSize
.elseif eax==VK_DOWN
.if fSnapToGrid
mov eax,(DIALOG ptr [esi]).y
add eax,Gridcy
xor edx,edx
idiv Gridcy
imul Gridcy
mov (DIALOG ptr [esi]).y,eax
.else
inc (DIALOG ptr [esi]).y
.endif
invoke UpdateCtl,hReSize
.endif
pop esi
.endif
.elseif edx && !eax
invoke GetWindowLong,hReSize,GWL_USERDATA
.if eax
push esi
mov esi,eax
mov eax,wParam
.if eax==VK_LEFT
mov eax,(DIALOG ptr [esi]).ccx
.if eax>1
dec (DIALOG ptr [esi]).ccx
invoke UpdateCtl,hReSize
.endif
.elseif eax==VK_RIGHT
inc (DIALOG ptr [esi]).ccx
invoke UpdateCtl,hReSize
.elseif eax==VK_UP
mov eax,(DIALOG ptr [esi]).ccy
.if eax>1
dec (DIALOG ptr [esi]).ccy
invoke UpdateCtl,hReSize
.endif
.elseif eax==VK_DOWN
inc (DIALOG ptr [esi]).ccy
invoke UpdateCtl,hReSize
.endif
pop esi
.endif
.elseif eax && edx
mov eax,wParam
.if eax==VK_UP || eax==VK_DOWN
invoke SendMessage,hPrpLstDlg,LB_GETCURSEL,0,0
.if eax==LB_ERR
invoke SendMessage,hPrpLstDlg,LB_SETCURSEL,0,0
.else
.if wParam==VK_DOWN
inc eax
.else
.if eax
dec eax
.endif
.endif
invoke SendMessage,hPrpLstDlg,LB_SETCURSEL,eax,0
.endif
invoke PropListSetPos
.if !eax
invoke PropListSetTxt,hPrpLstDlg
.endif
.elseif eax==VK_LEFT || eax==VK_RIGHT
invoke IsWindowVisible,hPrpEdtDlgCld
.if eax
invoke SetFocus,hPrpEdtDlgCld
.else
invoke IsWindowVisible,hPrpBtnDlgCld
.if eax
invoke SendMessage,hPrpLstDlg,WM_COMMAND,1,0
invoke IsWindowVisible,hPrpLstDlgCld
.if eax
invoke SetFocus,hPrpLstDlgCld
.endif
.endif
.endif
.endif
.endif
.elseif hMultiSel
mov ecx,wParam
.if eax && !edx
.if fSnapToGrid
mov eax,Gridcx
mov edx,Gridcy
.else
mov eax,1
mov edx,1
.endif
.if ecx==VK_UP
neg edx
xor eax,eax
.elseif ecx==VK_DOWN
xor eax,eax
.elseif ecx==VK_LEFT
neg eax
xor edx,edx
.elseif ecx==VK_RIGHT
xor edx,edx
.else
jmp ExDef
.endif
invoke MoveMultiSel,eax,edx
.elseif !eax && edx
mov eax,1
mov edx,1
.if ecx==VK_UP
neg edx
xor eax,eax
.elseif ecx==VK_DOWN
xor eax,eax
.elseif ecx==VK_LEFT
neg eax
xor edx,edx
.elseif ecx==VK_RIGHT
xor edx,edx
.else
jmp ExDef
.endif
invoke SizeMultiSel,eax,edx
.endif
.endif
.elseif eax==WM_HSCROLL
.if fEditMode
xor eax,eax
ret
.endif
mov eax,wParam
and eax,0FFFFh
.if eax==SB_THUMBTRACK || eax==SB_THUMBPOSITION
mov sinf.cbSize,sizeof sinf
mov sinf.fMask,SIF_POS
mov eax,wParam
shr eax,16
mov sinf.nPos,eax
invoke SetScrollInfo,hWin,SB_HORZ,addr sinf,TRUE
invoke GetWindowLong,hWin,DEWM_SCROLLX
sub eax,sinf.nPos
shl eax,3
invoke ScrollWindow,hWin,eax,0,NULL,NULL
invoke SetWindowLong,hWin,DEWM_SCROLLX,sinf.nPos
invoke GetClientRect,hWin,addr rect
mov rect.bottom,6
invoke InvalidateRect,hWin,addr rect,TRUE
invoke UpdateWindow,hWin
.elseif eax==SB_LINELEFT || eax==SB_LINERIGHT || eax==SB_PAGELEFT || eax==SB_PAGERIGHT
mov sinf.cbSize,sizeof sinf
mov sinf.fMask,SIF_POS
invoke GetScrollInfo,hWin,SB_HORZ,addr sinf
mov ecx,sinf.nPos
mov eax,wParam
.if eax==SB_LINERIGHT
inc ecx
.elseif eax==SB_LINELEFT
.if ecx
dec ecx
.endif
.elseif eax==SB_PAGERIGHT
add ecx,8
.elseif eax==SB_PAGELEFT
.if ecx>8
sub ecx,8
.else
mov ecx,0
.endif
.endif
shl ecx,16
or ecx,SB_THUMBPOSITION
invoke SendMessage,hWin,WM_HSCROLL,ecx,0
.endif
xor eax,eax
ret
.elseif eax==WM_VSCROLL
.if fEditMode
xor eax,eax
ret
.endif
mov eax,wParam
and eax,0FFFFh
.if eax==SB_THUMBTRACK || eax==SB_THUMBPOSITION
mov sinf.cbSize,sizeof sinf
mov sinf.fMask,SIF_POS
mov eax,wParam
shr eax,16
mov sinf.nPos,eax
invoke SetScrollInfo,hWin,SB_VERT,addr sinf,TRUE
invoke GetWindowLong,hWin,DEWM_SCROLLY
sub eax,sinf.nPos
shl eax,3
invoke ScrollWindow,hWin,0,eax,NULL,NULL
invoke SetWindowLong,hWin,DEWM_SCROLLY,sinf.nPos
invoke GetClientRect,hWin,addr rect
mov rect.right,6
invoke InvalidateRect,hWin,addr rect,TRUE
invoke UpdateWindow,hWin
.elseif eax==SB_LINEDOWN || eax==SB_LINEUP || eax==SB_PAGEDOWN || eax==SB_PAGEUP
mov sinf.cbSize,sizeof sinf
mov sinf.fMask,SIF_POS
invoke GetScrollInfo,hWin,SB_VERT,addr sinf
mov ecx,sinf.nPos
mov eax,wParam
.if eax==SB_LINEDOWN
inc ecx
.elseif eax==SB_LINEUP
.if ecx
dec ecx
.endif
.elseif eax==SB_PAGEDOWN
add ecx,8
.elseif eax==SB_PAGEUP
.if ecx>8
sub ecx,8
.else
mov ecx,0
.endif
.endif
shl ecx,16
or ecx,SB_THUMBPOSITION
invoke SendMessage,hWin,WM_VSCROLL,ecx,0
.endif
xor eax,eax
ret
.endif
ExDef:
invoke DefWindowProc,hWin,uMsg,wParam,lParam
Ex:
ret
DlgEditProc endp
PropertyProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL pt:POINT
LOCAL rect:RECT
mov eax,uMsg
.if eax==WM_CREATE
push hWin
pop hPrp
invoke Do_Property,hWin
.elseif eax==WM_DESTROY
.elseif eax==WM_SIZE
mov eax,lParam
movzx edx,ax
shr eax,16
mov pt.x,edx
mov pt.y,eax
invoke MoveWindow,hPrpCboDlg,0,0,pt.x,200,TRUE
mov edx,pt.y
sub edx,25
invoke MoveWindow,hPrpLstDlg,0,25,pt.x,edx,TRUE
.elseif eax==WM_MOUSEMOVE
.if hStatus
invoke SendMessage,hStatus,SB_SETTEXT,nStatus,offset szNULL
.endif
.elseif eax==WM_SETFONT
invoke SendMessage,hTlt,WM_SETFONT,wParam,lParam
invoke SendMessage,hPrpCboDlg,WM_SETFONT,wParam,lParam
invoke SendMessage,hPrpLstDlg,WM_SETFONT,wParam,lParam
invoke SendMessage,hPrpEdtDlgCld,WM_SETFONT,wParam,lParam
invoke SendMessage,hPrpLstDlgCld,WM_SETFONT,wParam,lParam
.elseif eax==WM_COMMAND
mov edx,wParam
shr edx,16
.if edx==LBN_SELCHANGE
invoke SendMessage,lParam,LB_GETCURSEL,0,0
.if eax!=LB_ERR
mov edx,eax
mov eax,lParam
.if eax==hPrpLstDlg
invoke PropListSetPos
.endif
.endif
.endif
.elseif eax==WM_DRAWITEM
push esi
mov esi,lParam
assume esi:ptr DRAWITEMSTRUCT
mov eax,[esi].hwndItem
.if eax==hPrpLstDlg
.if [esi].itemID!=LB_ERR
test [esi].itemState,ODS_SELECTED
.if ZERO?
invoke GetSysColor,COLOR_WINDOWTEXT
invoke SetTextColor,[esi].hdc,eax
invoke GetSysColor,COLOR_WINDOW
invoke SetBkColor,[esi].hdc,eax
.else
invoke GetSysColor,COLOR_HIGHLIGHTTEXT
invoke SetTextColor,[esi].hdc,eax
invoke GetSysColor,COLOR_HIGHLIGHT
invoke SetBkColor,[esi].hdc,eax
.endif
push [esi].rcItem.right
mov eax,[esi].hwndItem
mov [esi].rcItem.right,58
invoke ExtTextOut,[esi].hdc,0,0,ETO_OPAQUE,addr [esi].rcItem,NULL,0,NULL
pop [esi].rcItem.right
invoke SendMessage,[esi].hwndItem,LB_GETTEXT,[esi].itemID,addr tempbuff
mov eax,offset tempbuff
.while byte ptr [eax] && byte ptr [eax]!=VK_TAB
inc eax
.endw
sub eax,offset tempbuff
invoke TextOut,[esi].hdc,2,[esi].rcItem.top,addr tempbuff,eax
mov eax,[esi].hwndItem
invoke GetSysColor,COLOR_WINDOWTEXT
invoke SetTextColor,[esi].hdc,eax
invoke GetSysColor,COLOR_WINDOW
invoke SetBkColor,[esi].hdc,eax
mov edx,offset tempbuff
.while byte ptr [edx] && byte ptr [edx]!=VK_TAB
inc edx
.endw
inc edx
mov eax,edx
.while byte ptr [eax] && byte ptr [eax]!=VK_TAB
inc eax
.endw
sub eax,edx
invoke TextOut,[esi].hdc,60,[esi].rcItem.top,edx,eax
invoke CreatePen,PS_SOLID,0,0C0C0C0h
invoke SelectObject,[esi].hdc,eax
push eax
mov edx,[esi].rcItem.bottom
dec edx
invoke MoveToEx,[esi].hdc,[esi].rcItem.left,edx,NULL
mov edx,[esi].rcItem.bottom
dec edx
invoke LineTo,[esi].hdc,[esi].rcItem.right,edx
mov eax,[esi].hwndItem
mov edx,[esi].rcItem.left
add edx,58
invoke MoveToEx,[esi].hdc,edx,[esi].rcItem.top,NULL
mov edx,[esi].rcItem.left
add edx,58
invoke LineTo,[esi].hdc,edx,[esi].rcItem.bottom
pop eax
invoke SelectObject,[esi].hdc,eax
invoke DeleteObject,eax
.endif
.endif
assume esi:nothing
pop esi
xor eax,eax
ret
.elseif eax==WM_USER+9999
invoke GetClientRect,hWin,addr rect
mov eax,rect.right
mov edx,rect.bottom
shl edx,16
movzx eax,ax
or eax,edx
invoke SendMessage,hWin,WM_SIZE,SIZE_RESTORED,eax
xor eax,eax
jmp Ex
.endif
invoke DefWindowProc,hWin,uMsg,wParam,lParam
Ex:
ret
PropertyProc endp
IFDEF DLL
include RAResEdDll.asm
ELSE
include RAResEdLib.asm
ENDIF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -