?? versionedit.asm
字號:
lea esi,[esi+sizeof VERSIONITEM]
.endw
pop esi
mov al,' '
stosb
stosb
stosb
stosb
invoke SaveStr,edi,addr szEND
add edi,eax
mov al,0Dh
stosb
mov al,0Ah
stosb
mov al,' '
stosb
stosb
invoke SaveStr,edi,addr szEND
add edi,eax
mov al,0Dh
stosb
mov al,0Ah
stosb
mov al,' '
stosb
stosb
invoke SaveStr,edi,addr szBLOCK
add edi,eax
mov al,' '
stosb
mov al,22h
stosb
invoke SaveStr,edi,addr szVarFileInfo
add edi,eax
mov al,22h
stosb
mov al,0Dh
stosb
mov al,0Ah
stosb
mov al,' '
stosb
stosb
invoke SaveStr,edi,addr szBEGIN
add edi,eax
mov al,0Dh
stosb
mov al,0Ah
stosb
mov al,' '
stosb
stosb
stosb
stosb
invoke SaveStr,edi,addr szVALUE
add edi,eax
mov al,' '
stosb
mov al,22h
stosb
invoke SaveStr,edi,addr szTranslation
add edi,eax
mov al,22h
stosb
mov al,','
stosb
mov al,' '
stosb
mov al,'0'
stosb
mov al,'x'
stosb
mov eax,[esi].VERSIONMEM.lng
invoke hexEax
invoke lstrcpy,edi,offset strHex+4
add edi,4
mov al,','
stosb
mov al,' '
stosb
mov al,'0'
stosb
mov al,'x'
stosb
mov eax,[esi].VERSIONMEM.chs
invoke hexEax
invoke lstrcpy,edi,offset strHex+4
add edi,4
mov al,0Dh
stosb
mov al,0Ah
stosb
mov al,' '
stosb
stosb
invoke SaveStr,edi,addr szEND
add edi,eax
mov al,0Dh
stosb
mov al,0Ah
stosb
invoke SaveStr,edi,addr szEND
add edi,eax
mov al,0Dh
stosb
mov al,0Ah
stosb
mov al,0
stosb
pop eax
ret
SaveVer:
mov eax,[esi]
call SaveVerItem
mov eax,[esi+4]
call SaveVerItem
mov eax,[esi+8]
call SaveVerItem
mov eax,[esi+12]
call SaveVerItem
dec edi
mov al,0Dh
stosb
mov al,0Ah
stosb
retn
SaveVerItem:
invoke ResEdBinToDec,eax,edi
invoke lstrlen,edi
lea edi,[edi+eax]
mov al,','
stosb
retn
SaveHex:
mov word ptr [edi],'x0'
add edi,2
invoke hexEax
invoke lstrcpy,edi,offset strHex
add edi,8
mov al,0Dh
stosb
mov al,0Ah
stosb
retn
ExportVersion endp
SaveVersion proc uses ebx esi edi,hWin:HWND
LOCAL nInx:DWORD
LOCAL buffer[256]:BYTE
invoke GetWindowLong,hWin,GWL_USERDATA
.if !eax
invoke SendMessage,hPrj,PRO_ADDITEM,TPE_VERSION,FALSE
.endif
mov ebx,eax
mov esi,[eax].PROJECT.hmem
invoke GetDlgItemText,hWin,IDC_EDTVERNAME,addr [esi].VERSIONMEM.szname,32
invoke GetDlgItemInt,hWin,IDC_EDTVERID,NULL,FALSE
mov [esi].VERSIONMEM.value,eax
invoke GetProjectItemName,ebx,addr buffer
invoke SetProjectItemName,ebx,addr buffer
invoke GetDlgItemText,hWin,IDC_EDTVERFILE,addr buffer,16
push esi
lea esi,[esi].VERSIONMEM.fv
call GetVerNum
pop esi
invoke GetDlgItemText,hWin,IDC_EDTVERPROD,addr buffer,16
push esi
lea esi,[esi].VERSIONMEM.pv
call GetVerNum
pop esi
invoke SendDlgItemMessage,hWin,IDC_CBOVEROS,CB_GETCURSEL,0,0
invoke SendDlgItemMessage,hWin,IDC_CBOVEROS,CB_GETITEMDATA,eax,0
mov [esi].VERSIONMEM.os,eax
invoke SendDlgItemMessage,hWin,IDC_CBOVERTYPE,CB_GETCURSEL,0,0
invoke SendDlgItemMessage,hWin,IDC_CBOVERTYPE,CB_GETITEMDATA,eax,0
mov [esi].VERSIONMEM.ft,eax
invoke SendDlgItemMessage,hWin,IDC_CBOVERLANG,CB_GETCURSEL,0,0
invoke SendDlgItemMessage,hWin,IDC_CBOVERLANG,CB_GETITEMDATA,eax,0
mov [esi].VERSIONMEM.lng,eax
invoke SendDlgItemMessage,hWin,IDC_CBOVERCHAR,CB_GETCURSEL,0,0
invoke SendDlgItemMessage,hWin,IDC_CBOVERCHAR,CB_GETITEMDATA,eax,0
mov [esi].VERSIONMEM.chs,eax
lea esi,[esi+sizeof VERSIONMEM]
mov nInx,0
.while TRUE
mov [esi].VERSIONITEM.szname,0
mov [esi].VERSIONITEM.szvalue,0
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_GETTEXT,nInx,addr [esi].VERSIONITEM.szname
.break .if eax==LB_ERR
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_GETITEMDATA,nInx,0
invoke lstrcpy,addr [esi].VERSIONITEM.szvalue,eax
lea esi,[esi+sizeof VERSIONITEM]
inc nInx
.endw
ret
GetVerNum:
lea edi,buffer
call GetVerNumItem
mov [esi],eax
call GetVerNumItem
mov [esi+4],eax
call GetVerNumItem
mov [esi+8],eax
call GetVerNumItem
mov [esi+12],eax
retn
GetVerNumItem:
invoke ResEdDecToBin,edi
.while byte ptr [edi]!='.' && byte ptr [edi]
inc edi
.endw
.if byte ptr [edi]=='.'
inc edi
.endif
retn
SaveVersion endp
VersionSetCbo proc uses esi,hWin:HWND,nID:DWORD,lpKey:DWORD,nVal:DWORD
LOCAL nInx:DWORD
mov esi,lpKey
.while byte ptr [esi+4]
push [esi]
add esi,4
invoke SendDlgItemMessage,hWin,nID,CB_ADDSTRING,0,esi
pop edx
invoke SendDlgItemMessage,hWin,nID,CB_SETITEMDATA,eax,edx
invoke lstrlen,esi
lea esi,[esi+eax+1]
.endw
mov nInx,0
.while TRUE
invoke SendDlgItemMessage,hWin,nID,CB_GETITEMDATA,nInx,0
.break .if eax==CB_ERR
.if eax==nVal
invoke SendDlgItemMessage,hWin,nID,CB_SETCURSEL,nInx,0
.break
.endif
inc nInx
.endw
ret
VersionSetCbo endp
VersionEditProc proc uses esi edi,hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL nInx:DWORD
LOCAL buffer[256]:BYTE
mov eax,uMsg
.if eax==WM_INITDIALOG
mov esi,lParam
invoke SetWindowLong,hWin,GWL_USERDATA,esi
.if esi
mov esi,[esi].PROJECT.hmem
.else
mov esi,offset defver
.endif
invoke RtlZeroMemory,offset szVersionTxt,sizeof szVersionTxt
invoke SendDlgItemMessage,hWin,IDC_EDTVERNAME,EM_LIMITTEXT,31,0
invoke SetDlgItemText,hWin,IDC_EDTVERNAME,addr [esi].VERSIONMEM.szname
invoke SendDlgItemMessage,hWin,IDC_EDTVERID,EM_LIMITTEXT,5,0
invoke SetDlgItemInt,hWin,IDC_EDTVERID,[esi].VERSIONMEM.value,TRUE
invoke SendDlgItemMessage,hWin,IDC_EDTVERFILE,EM_LIMITTEXT,16,0
push esi
lea esi,[esi].VERSIONMEM.fv
call ConvVer
pop esi
invoke SetDlgItemText,hWin,IDC_EDTVERFILE,addr buffer
invoke SendDlgItemMessage,hWin,IDC_EDTVERPROD,EM_LIMITTEXT,16,0
push esi
lea esi,[esi].VERSIONMEM.pv
call ConvVer
pop esi
invoke SetDlgItemText,hWin,IDC_EDTVERPROD,addr buffer
invoke VersionSetCbo,hWin,IDC_CBOVEROS,offset szVerOS,[esi].VERSIONMEM.os
invoke VersionSetCbo,hWin,IDC_CBOVERTYPE,offset szVerFT,[esi].VERSIONMEM.ft
invoke VersionSetCbo,hWin,IDC_CBOVERLANG,addr szVerLNG,[esi].VERSIONMEM.lng
invoke VersionSetCbo,hWin,IDC_CBOVERCHAR,addr szVerCHS,[esi].VERSIONMEM.chs
lea esi,[esi+sizeof VERSIONMEM]
mov edi,offset szVerTpe
.while byte ptr [edi]
call AddTpe
invoke lstrlen,edi
lea edi,[edi+eax+1]
.endw
mov edi,offset szVersionTxt
.while [esi].VERSIONITEM.szname
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_ADDSTRING,0,addr [esi].VERSIONITEM.szname
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_SETITEMDATA,eax,edi
invoke lstrcpy,edi,addr [esi].VERSIONITEM.szvalue
add edi,256
lea esi,[esi+sizeof VERSIONITEM]
.endw
invoke SendDlgItemMessage,hWin,IDC_EDTVER,EM_LIMITTEXT,255,0
invoke SendDlgItemMessage,hWin,IDC_EDTVERTPE,EM_LIMITTEXT,63,0
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_SETCURSEL,0,0
invoke SendMessage,hWin,WM_COMMAND,(LBN_SELCHANGE shl 16) or IDC_LSTVER,0
.elseif eax==WM_COMMAND
mov eax,wParam
mov edx,eax
shr edx,16
and eax,0FFFFh
.if edx==BN_CLICKED
.if eax==IDOK
invoke SaveVersion,hWin
invoke SendMessage,hPrj,PRO_SETMODIFY,TRUE,0
invoke SendMessage,hWin,WM_CLOSE,NULL,NULL
.elseif eax==IDCANCEL
invoke SendMessage,hWin,WM_CLOSE,NULL,NULL
.elseif eax==IDC_BTNVERADD
invoke SendDlgItemMessage,hWin,IDC_EDTVERTPE,WM_GETTEXT,sizeof buffer,addr buffer
lea edi,buffer
invoke GetWindowLong,hWin,GWL_USERDATA
.if eax
mov esi,[eax].PROJECT.hmem
.else
mov esi,offset defver
.endif
lea esi,[esi+sizeof VERSIONMEM]
call AddTpe
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_RESETCONTENT,0,0
mov edi,offset szVersionTxt
mov nInx,-1
.while [esi].VERSIONITEM.szname
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_ADDSTRING,0,addr [esi].VERSIONITEM.szname
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_SETITEMDATA,eax,edi
invoke lstrcpy,edi,addr [esi].VERSIONITEM.szvalue
inc nInx
add edi,256
lea esi,[esi+sizeof VERSIONITEM]
.endw
mov buffer,0
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_SETCURSEL,nInx,0
invoke SendDlgItemMessage,hWin,IDC_EDTVERTPE,WM_SETTEXT,0,addr buffer
invoke SendMessage,hWin,WM_COMMAND,(LBN_SELCHANGE shl 16) or IDC_LSTVER,0
.endif
.elseif edx==EN_CHANGE
.if eax==IDC_EDTVER
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_GETCURSEL,0,0
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_GETITEMDATA,eax,0
invoke SendDlgItemMessage,hWin,IDC_EDTVER,WM_GETTEXT,256,eax
.elseif eax==IDC_EDTVERTPE
invoke GetDlgItem,hWin,IDC_BTNVERADD
push eax
invoke SendDlgItemMessage,hWin,IDC_EDTVERTPE,WM_GETTEXTLENGTH,0,0
pop edx
invoke EnableWindow,edx,eax
.endif
.elseif edx==LBN_SELCHANGE
.if eax==IDC_LSTVER
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_GETCURSEL,0,0
.if eax!=LB_ERR
invoke SendDlgItemMessage,hWin,IDC_LSTVER,LB_GETITEMDATA,eax,0
invoke SendDlgItemMessage,hWin,IDC_EDTVER,WM_SETTEXT,0,eax
.endif
.endif
.endif
.elseif eax==WM_CLOSE
invoke EndDialog,hWin,NULL
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
ConvVer:
lea edi,buffer
invoke ResEdBinToDec,[esi],edi
invoke lstrlen,edi
lea edi,[edi+eax]
mov al,'.'
stosb
invoke ResEdBinToDec,[esi+4],edi
invoke lstrlen,edi
lea edi,[edi+eax]
mov al,'.'
stosb
invoke ResEdBinToDec,[esi+8],edi
invoke lstrlen,edi
lea edi,[edi+eax]
mov al,'.'
stosb
invoke ResEdBinToDec,[esi+12],edi
retn
AddTpe:
push esi
.while [esi].VERSIONITEM.szname
invoke lstrcmpi,addr [esi].VERSIONITEM.szname,edi
.break .if !eax
lea esi,[esi+sizeof VERSIONITEM]
.endw
invoke lstrcpy,addr [esi].VERSIONITEM.szname,edi
pop esi
retn
VersionEditProc endp
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -