www.pudn.com > gate.rar > OtherProc.asm
;-----------------------------------------------
;转换字符到数字的函数
StrToDword proc uses ecx edi edx esi String:DWORD
LOCAL Result:DWORD
mov Result,0
mov edi,String
invoke lstrlen,String
.while eax!=0
xor edx,edx
mov dl,byte ptr [edi]
sub dl,"0"
mov esi,eax
dec esi
push eax
mov eax,edx
push ebx
mov ebx,10
.while esi > 0
mul ebx
dec esi
.endw
pop ebx
add Result,eax
pop eax
inc edi
dec eax
.endw
mov eax,Result
ret
StrToDword endp
;================================
;读取播放列表
LoadList proc hWin,lParam
local TempNum
local TempBuff[20]:BYTE
;读出播放列表
;循环读取播放列表
mov TempNum,0
CONN:
lea edi,OnlyFileName
mov ecx,sizeof OnlyFileName
mov al,0
rep stosb
lea eax,temp
invoke wsprintf,offset MciResult,eax,TempNum
lea eax,MP3List
invoke GetPrivateProfileString,eax,offset MciResult,NULL,offset Buffer1,sizeof Buffer1,offset INIPath
cmp eax,0
je EOF ;如果不存在相关键值则表示已经到尾,跳出
;文件名
lea esi,Buffer1
lea edi,OnlyFileName
@@:
lodsb
cmp al,'>'
jz @F
stosb
cmp al,0
jnz @B
@@:
;文件路径
lea edi,MciResult
@@:
lodsb
stosb
cmp al,0
jnz @B
invoke wsprintf,offset TempBuffer,offset tempstr,TempNum,offset OnlyFileName
invoke SendMessage,hList,LB_ADDSTRING,0,offset TempBuffer
invoke SendMessage,hList1,LB_ADDSTRING,0,offset MciResult
inc TempNum ;继续选择下一个
jmp CONN
EOF:
cmp lParam,1111
jz @F
invoke LoadString,hInstance,11,addr TempBuff,sizeof TempBuff
invoke SetDlgItemText,hWin,1001,addr TempBuff
;支持文件拖放
invoke DragAcceptFiles,hWin,TRUE
invoke SetFocus,hList
lea edi,Buffer1
mov ecx,sizeof Buffer1
mov al,0
rep stosb
@@:
invoke SendMessage,hList1,LB_GETCOUNT,0,0
sub eax,1
invoke SendMessage,hScroll,TBM_SETRANGEMAX,TRUE,eax
ret
LoadList endp
;进度条过程
TrackProc proc htt,utt,wtt,ltt
local ps:PAINTSTRUCT
local hdc,Num
local rect:RECT
.if utt==WM_LBUTTONDOWN
invoke LoadString,hInstance,40,offset MciResult,sizeof MciResult
invoke SetDlgItemText,hWnd,1001,offset MciResult
invoke SetCapture,htt
.elseif utt==WM_LBUTTONUP
.if Mp3State!=0
invoke SendMessage,htt,TBM_GETPOS,0,0
mov Num,eax
.if PlayMode==TRUE
lea eax,GetCDCurrentTrackPos
invoke mciSendString,offset Buffer,offset MciResult,sizeof MciResult,hWnd
invoke StrToDword,offset MciResult
add eax,Num
lea ecx,PlayCD
invoke wsprintf,offset Buffer,ecx,eax
invoke mciSendString,offset Buffer,offset MciResult,sizeof MciResult,hWnd
.else
lea ecx,PlayMp3From
invoke wsprintf,offset Buffer,ecx,eax
invoke mciSendString,offset Buffer,offset MciResult,sizeof MciResult,hWnd
lea eax,PlayMp3
invoke mciSendString,eax,offset MciResult,sizeof MciResult,hWnd
.endif
invoke SetDlgItemText,hWnd,1001,offset CurrPlayFileName
.if PauseState==TRUE
invoke GetDlgItem,hWnd,11
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hPauseBitmap
.endif
mov PauseState,FALSE
mov Mp3State,1
invoke SetTimer,hWnd,100,1000,offset TimeEventProc
.endif
invoke ReleaseCapture
.elseif utt==WM_RBUTTONUP
invoke SetDlgItemText,hWnd,1001,offset CurrPlayFileName
mov Mp3State,1
invoke ReleaseCapture
.elseif utt==WM_PAINT
invoke BeginPaint,htt,addr ps
invoke SelectObject,ps.hdc,hBackBrush
invoke GetStockObject,NULL_PEN
invoke SelectObject,ps.hdc,eax
push eax
invoke Rectangle,ps.hdc,0,0,277,21
invoke SelectObject,ps.hdc,hPen
invoke SelectObject,ps.hdc,hBackBrush0
invoke SendMessage,htt,TBM_GETCHANNELRECT,0,addr rect
sub rect.left,5
add rect.right,5
sub rect.top,2
add rect.bottom,3
invoke Rectangle,ps.hdc,rect.left,rect.top,rect.right,rect.bottom
invoke SelectObject,ps.hdc,hBackBrush1
invoke SendMessage,htt,TBM_GETTHUMBRECT,0,addr rect
invoke Rectangle,ps.hdc,rect.left,rect.top,rect.right,rect.bottom
pop eax
invoke SelectObject,ps.hdc,eax
invoke DeleteObject,eax
invoke EndPaint,htt,addr ps
.endif
invoke GetWindowLong,htt,GWL_USERDATA
invoke CallWindowProc,eax,htt,utt,wtt,ltt
ret
TrackProc endp
;滚动条过程
ScrollProc proc hs,us,ws,ls
local ps:PAINTSTRUCT
local hdc
local rect:RECT
.if us==WM_MOUSEMOVE
.if ws==MK_LBUTTON
invoke InvalidateRect,hs,NULL,TRUE
invoke InvalidateRect,hList,NULL,TRUE
invoke SendMessage,hScroll,TBM_GETPOS,0,0
invoke SendMessage,hList,LB_SETCARETINDEX,eax,FALSE
.endif
.elseif us==WM_LBUTTONUP
invoke InvalidateRect,hs,NULL,TRUE
invoke InvalidateRect,hList,NULL,TRUE
invoke SendMessage,hScroll,TBM_GETPOS,0,0
invoke SendMessage,hList,LB_SETCARETINDEX,eax,FALSE
.elseif us==WM_PAINT
invoke BeginPaint,hs,addr ps
mov hdc,eax
invoke SelectObject,hdc,hListBrush
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc,eax
invoke Rectangle,hdc,0,0,20,130
invoke SelectObject,hdc,hBackBrush2
invoke Rectangle,hdc,11,0,20,130
invoke SelectObject,hdc,hBackBrush0
invoke Rectangle,hdc,5,1,12,129
invoke SelectObject,hdc,hPen
invoke SelectObject,hdc,hBackBrush1
invoke SendMessage,hs,TBM_GETTHUMBRECT,0,addr rect
invoke Rectangle,hdc,rect.left,rect.top,rect.right,rect.bottom
invoke EndPaint,hs,addr ps
.endif
invoke GetWindowLong,hs,GWL_USERDATA
invoke CallWindowProc,eax,hs,us,ws,ls
ret
ScrollProc endp
SoundConProc proc hsc,usc,wsc,lsc
local ps:PAINTSTRUCT
local hdc
local rect:RECT
local tempn:WORD
local tempn1:WORD
local TempBuff[50]:BYTE
.if usc==WM_LBUTTONDOWN
invoke SetCapture,hsc
.elseif usc==WM_MOUSEMOVE
.if wsc==MK_LBUTTON
invoke GetDlgCtrlID,hsc
.if eax==1000
invoke SendMessage,hsc,TBM_GETPOS,0,0
shl eax,8
mov tempn,ax
mov tempn1,ax
invoke waveOutGetVolume,0,offset Volume
add tempn,ax
add tempn1,ax
MAKEDWORD tempn,tempn1
invoke waveOutSetVolume,0,eax
.elseif eax==1007
invoke SendMessage,hsc,TBM_GETPOS,0,0
mov ShowSleep,eax
.elseif eax==1006
invoke SendMessage,hsc,TBM_GETPOS,0,0
mov WordShowTime,eax
.endif
invoke GetDlgItem,hWnd,9
invoke InvalidateRect,eax,NULL,TRUE
.endif
.elseif usc==WM_LBUTTONUP
invoke GetDlgCtrlID,hsc
.if eax==1000
invoke SendMessage,hsc,TBM_GETPOS,0,0
shl eax,8
mov tempn,ax
mov tempn1,ax
invoke waveOutGetVolume,0,offset Volume
add tempn,ax
add tempn1,ax
MAKEDWORD tempn,tempn1
invoke waveOutSetVolume,0,eax
.elseif eax==1007
invoke SendMessage,hsc,TBM_GETPOS,0,0
mov ShowSleep,eax
.elseif eax==1006
invoke SendMessage,hsc,TBM_GETPOS,0,0
mov WordShowTime,eax
.endif
invoke GetDlgItem,hWnd,9
invoke InvalidateRect,eax,NULL,TRUE
invoke ReleaseCapture
.elseif usc==WM_RBUTTONUP
invoke ReleaseCapture
.elseif usc==WM_PAINT
invoke BeginPaint,hsc,addr ps
mov hdc,eax
invoke SelectObject,hdc,hBackBrush2
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc,eax
invoke Rectangle,hdc,0,0,277,21
invoke SelectObject,hdc,hPen
invoke SelectObject,hdc,hBackBrush0
invoke SendMessage,hsc,TBM_GETCHANNELRECT,0,addr rect
sub rect.top,2
add rect.bottom,2
invoke Rectangle,hdc,rect.left,rect.top,rect.right,rect.bottom
invoke SelectObject,hdc,hBackBrush1
invoke SendMessage,hsc,TBM_GETTHUMBRECT,0,addr rect
invoke Rectangle,hdc,rect.left,rect.top,rect.right,rect.bottom
invoke EndPaint,hsc,addr ps
.endif
invoke GetWindowLong,hsc,GWL_USERDATA
invoke CallWindowProc,eax,hsc,usc,wsc,lsc
ret
SoundConProc endp
;歌词栏过程
SongWordProc proc hsw,usw,wsw,lsw
local ps:PAINTSTRUCT
local hdc,hdc1,tempnumeric,allnum,tempnum1
local rect:RECT,rect1:RECT
local tempcolor:BYTE
local TempBuff[10]:BYTE
.if usw==WM_LBUTTONDOWN
.if SongWordShowMode==TRUE
mov SongWordShowMode,FALSE
invoke LoadString,hInstance,43,offset MciResult,sizeof MciResult
.else
mov SongWordShowMode,TRUE
invoke LoadString,hInstance,44,offset MciResult,sizeof MciResult
.endif
invoke SetDlgItemText,hWnd,1001,offset MciResult
.elseif usw==WM_LBUTTONUP || usw==WM_RBUTTONDOWN
invoke SetDlgItemText,hWnd,1001,offset CurrPlayFileName
.elseif usw==WM_PAINT
invoke BeginPaint,hsw,addr ps
mov hdc,eax
mov rect.top,3
mov rect.left,0
mov rect.right,275
mov rect.bottom,19
invoke SetBkMode,hdc,TRANSPARENT
invoke GetStockObject,DEFAULT_GUI_FONT
invoke SelectObject,hdc,eax
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc,eax
invoke SetTextColor,hdc,Green
invoke SelectObject,hdc,hBackBrush2
invoke Rectangle,hdc,0,0,275,19
.if ExistFile==TRUE && ProgMin==FALSE && RecordMode==FALSE
invoke SelectObject,hdc,hYJBrush
invoke wsprintf,addr TempBuff,offset QuickFind,offset TimeBuffer
invoke InString,1,offset SongWordFile,addr TempBuff
.if eax!=0
lea esi,SongWordFile
add esi,eax
add esi,4
@CONN:
lodsb
cmp al,'0'
jl @F
cmp al,'9'
jle @CONN
@@:
cmp al,'['
jz @CONN
cmp al,']'
jz @CONN
cmp al,'.'
jz @CONN
cmp al,':'
jz @CONN
cmp al,'='
jz @CONN
sub esi,1
lea edi,CurrSongWord
@@:
lodsb
;是否到尾
cmp al,13
jz @Skip
cmp al,0
jz @Skip
stosb
jmp @B
@Skip:
mov al,0
stosb
invoke GetDC,hsw
mov hdc1,eax
invoke GetStockObject,DEFAULT_GUI_FONT
invoke SelectObject,hdc1,eax
invoke SetBkMode,hdc1,TRANSPARENT
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc1,eax
invoke SelectObject,hdc1,hYJBrush
.if SongWordShowMode==TRUE
invoke SetTextColor,hdc1,Green
;关闭
invoke lstrlen,offset SecondSongWord
mov tempnumeric,eax
@@:
mov eax,tempnumeric
cmp eax,0
jz @F
lea edi,SecondSongWord
add edi,tempnumeric
mov al,0
stosb
invoke RoundRect,hdc1,0,0,275,19,20,20
invoke DrawText,hdc1,offset SecondSongWord,-1,addr rect,DT_CENTER
invoke Sleep,WordShowTime
dec tempnumeric
jmp @B
@@:
;展开
invoke lstrlen,offset CurrSongWord
mov allnum,eax
mov tempnumeric,0
@@:
mov eax,tempnumeric
cmp eax,allnum
ja @F
lea esi,CurrSongWord
lea edi,SecondSongWord
mov ecx,tempnumeric
rep movsb
invoke RoundRect,hdc1,0,0,275,19,20,20
invoke DrawText,hdc1,offset SecondSongWord,-1,addr rect,DT_CENTER
invoke Sleep,WordShowTime
inc tempnumeric
jmp @B
@@:
.else
invoke RoundRect,hdc1,0,0,275,19,20,20
;关闭
mov tempcolor,250
@@:
cmp tempcolor,0
jz @F
xor eax,eax
mov al,0
shl eax,8
mov al,tempcolor
shl eax,8
mov al,0
invoke SetTextColor,hdc1,eax
invoke DrawText,hdc1,offset SecondSongWord,-1,addr rect,DT_CENTER
invoke Sleep,WordShowTime
sub tempcolor,10
jmp @B
@@:
;展开
invoke RoundRect,hdc1,0,0,275,19,20,20
mov tempcolor,0
@@:
cmp tempcolor,250
jz @F
xor eax,eax
mov al,0
shl eax,8
mov al,tempcolor
shl eax,8
mov al,0
invoke SetTextColor,hdc1,eax
invoke DrawText,hdc1,offset CurrSongWord,-1,addr rect,DT_CENTER
invoke Sleep,WordShowTime
add tempcolor,10
jmp @B
@@:
.endif
invoke lstrcpy,offset SecondSongWord,offset CurrSongWord
invoke ReleaseDC,hsw,hdc1
ret
.endif
.else
invoke SelectObject,hdc,hListBrush
.if NotReadSongWordB==FALSE
invoke LoadString,hInstance,49,addr SecondSongWord,sizeof CurrSongWord
.elseif Mp3State==0
invoke LoadString,hInstance,41,addr SecondSongWord,sizeof CurrSongWord
.elseif RecordMode==TRUE
invoke LoadString,hInstance,47,addr SecondSongWord,sizeof CurrSongWord
.else
invoke LoadString,hInstance,6,addr SecondSongWord,sizeof CurrSongWord
.endif
.endif
invoke RoundRect,hdc,0,0,275,19,20,20
invoke DrawText,hdc,offset SecondSongWord,-1,addr rect,DT_CENTER
invoke EndPaint,hsw,addr ps
.else
invoke GetWindowLong,hsw,GWL_USERDATA
invoke CallWindowProc,eax,hsw,usw,wsw,lsw
.endif
ret
SongWordProc endp
;列表框过程
ListProc proc hl,ul,wl,ll
local ps:PAINTSTRUCT
local hdc,TempNum,Index,Num,Num1
local rect:RECT
local TempBuff[200]:BYTE
.if ul==WM_KEYDOWN
.if wl==VK_LEFT || wl==VK_RIGHT || wl==VK_UP || wl==VK_DOWN || wl==VK_PRIOR || wl==VK_NEXT
invoke InvalidateRect,hl,NULL,TRUE
invoke InvalidateRect,hScroll,NULL,TRUE
invoke SendMessage,hList,LB_GETCARETINDEX,0,0
invoke SendMessage,hScroll,TBM_SETPOS,TRUE,eax
.endif
.elseif ul==WM_LBUTTONDOWN
invoke InvalidateRect,hl,NULL,TRUE
.elseif ul==WM_MOUSEMOVE
.if wl==MK_LBUTTON
invoke InvalidateRect,hl,NULL,TRUE
.endif
.elseif ul==WM_PAINT
invoke BeginPaint,hl,addr ps
mov hdc,eax
invoke SetBkMode,hdc,TRANSPARENT
invoke GetStockObject,DEFAULT_GUI_FONT
invoke SelectObject,hdc,eax
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc,eax
invoke SelectObject,hdc,hListBrush
invoke Rectangle,hdc,-1,-1,264,115
invoke SendMessage,hList,LB_GETCARETINDEX,0,0
mov Num,eax
invoke SendMessage,hList1,LB_GETCARETINDEX,0,0
mov Num1,eax
invoke SendMessage,hList,LB_GETTOPINDEX,0,0
mov Index,eax
add eax,9
mov TempNum,eax
@@:
mov eax,Index
cmp eax,TempNum
jae @F
.if eax==Num && eax==Num1
RGB 0,123,100
.elseif eax==Num
mov eax,Green
.elseif eax==Num1
RGB 0,128,180
.else
RGB 150,150,150
.endif
invoke SetTextColor,hdc,eax
invoke SendMessage,hList,LB_GETTEXT,Index,addr TempBuff
invoke SendMessage,hList,LB_GETITEMRECT,Index,addr rect
add rect.left,1
invoke DrawText,hdc,addr TempBuff,-1,addr rect,0
inc Index
jmp @B
@@:
nop
invoke EndPaint,hl,addr ps
invoke GetDlgItem,hWnd,24
.endif
invoke GetWindowLong,hl,GWL_USERDATA
invoke CallWindowProc,eax,hl,ul,wl,ll
ret
ListProc endp
;关于对话框过程
AboutDlgProc proc ha,ua,wa,la
local TempNum
local TempBuff[100]:BYTE
.if ua==WM_INITDIALOG
invoke LoadIcon,hInstance,100
invoke SendMessage,ha,WM_SETICON,ICON_SMALL,eax
.elseif ua==WM_COMMAND
.if wa==1000
invoke ShellExecute,0,0,offset HelpFile,0,0,0
.elseif wa==IDOK
invoke SendMessage,ha,WM_CLOSE,0,0
.endif
.elseif ua==WM_CLOSE
invoke EndDialog,ha,FALSE
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
AboutDlgProc endp
;关于对话框过程
SettingDlgProc proc hsd,usd,wsd,lsd
local ofnn:OPENFILENAME
.if usd==WM_INITDIALOG
invoke LoadIcon,hInstance,100
invoke SendMessage,hsd,WM_SETICON,ICON_SMALL,eax
;总在最前
invoke CheckDlgButton,hsd,1002,AlwaysTopB
;是否允许读取歌词设置
invoke CheckDlgButton,hsd,1005,NotReadSongWordSetB
;是否允许读取歌词设置
invoke CheckDlgButton,hsd,1004,NotReadSongWordB
;播放完毕复位
invoke CheckDlgButton,hsd,1001,PlayDoneResetB
;指定目录有效
cmp AppDirEnableB,0
jz @F
invoke CheckDlgButton,hsd,1013,BST_CHECKED
;路径显示
invoke GetDlgItem,hsd,1012
invoke EnableWindow,eax,TRUE
invoke GetDlgItem,hsd,1009
invoke EnableWindow,eax,TRUE
invoke SetDlgItemText,hsd,1012,offset AppDirPathBuff
@@:
;创建热键
invoke GetPrivateProfileInt,offset Config,offset CreateHotKey,0,offset INIPath
cmp eax,0
jz @F
invoke CheckDlgButton,hsd,1003,BST_CHECKED
@@:
.elseif usd==WM_COMMAND
mov eax,wsd
.if ax==1013
invoke IsDlgButtonChecked,hsd,1013
.if eax==BST_UNCHECKED
invoke GetDlgItem,hsd,1012
invoke EnableWindow,eax,FALSE
invoke GetDlgItem,hsd,1009
invoke EnableWindow,eax,FALSE
.else
invoke GetDlgItem,hsd,1012
invoke EnableWindow,eax,TRUE
invoke GetDlgItem,hsd,1009
invoke EnableWindow,eax,TRUE
.endif
.elseif ax==1009
lea eax,PathFileFilter
mov ofn.lpstrFilter,eax
invoke LoadString,hInstance,11,offset TempBuffer,sizeof TempBuffer
mov ofn.lpstrTitle,offset TempBuffer
mov ofn.lpstrFile,offset TempBuffer
mov ofn.nMaxFile,sizeof TempBuffer
invoke GetOpenFileName,offset ofn
.if eax!=0
invoke GetPathOnly,offset TempBuffer,offset Buffer
invoke SendDlgItemMessage,hsd,1012,WM_SETTEXT,MAX_PATH,offset Buffer
.endif
.elseif ax==1010
invoke IsDlgButtonChecked,hsd,1002
mov AlwaysTopB,eax
invoke wsprintf,addr TempBuffer,offset tempnum,eax
invoke WritePrivateProfileString,offset Config,offset AlwaysTop,addr TempBuffer,offset INIPath
.if AlwaysTopB==0
invoke SetWindowPos,hWnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE or SWP_NOMOVE
.else
invoke SetWindowPos,hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE or SWP_NOMOVE
.endif
invoke IsDlgButtonChecked,hsd,1004
mov NotReadSongWordB,eax
invoke wsprintf,addr TempBuffer,offset tempnum,eax
invoke WritePrivateProfileString,offset Config,offset NotReadSongWord,addr TempBuffer,offset INIPath
invoke IsDlgButtonChecked,hsd,1005
mov NotReadSongWordSetB,eax
invoke wsprintf,addr TempBuffer,offset tempnum,eax
invoke WritePrivateProfileString,offset Config,offset NotReadSongWordSet,addr TempBuffer,offset INIPath
invoke IsDlgButtonChecked,hsd,1001
mov PlayDoneResetB,eax
invoke wsprintf,addr TempBuffer,offset tempnum,eax
invoke WritePrivateProfileString,offset Config,offset PlayDoneReset,addr TempBuffer,offset INIPath
invoke IsDlgButtonChecked,hsd,1003
invoke wsprintf,addr TempBuffer,offset tempnum,eax
invoke WritePrivateProfileString,offset Config,offset CreateHotKey,addr TempBuffer,offset INIPath
invoke IsDlgButtonChecked,hsd,1013
mov AppDirEnableB,eax
invoke wsprintf,addr TempBuffer,offset tempnum,eax
invoke WritePrivateProfileString,offset Config,offset AppDirEnable,addr TempBuffer,offset INIPath
invoke GetDlgItemText,hsd,1012,addr AppDirPathBuff,MAX_PATH
invoke WritePrivateProfileString,offset Config,offset AppDirPath,addr AppDirPathBuff,offset INIPath
invoke SendMessage,hsd,WM_CLOSE,0,0
.elseif ax==1011
invoke SendMessage,hsd,WM_CLOSE,0,0
.endif
.elseif usd==WM_CLOSE
invoke EndDialog,hsd,FALSE
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
SettingDlgProc endp
;控制按钮的过程
ButtProc proc hb,ub,wb,lb
local ID
local rect:RECT
local TempBuff[50]:BYTE
invoke GetDlgCtrlID,hb
mov ID,eax
.if ub==WM_LBUTTONDOWN
invoke SetCapture,hb
.if ID==10
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPlayBitmap0
.elseif ID==11
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPauseBitmap0
.elseif ID==12
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hStopBitmap0
.elseif ID==13
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPreBitmap0
.elseif ID==14
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hNextBitmap0
.elseif ID==15
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hOpenBitmap0
.elseif ID==16
.if PlayMode==TRUE
invoke LoadString,hInstance,31,addr TempBuff,sizeof TempBuff
.else
invoke LoadString,hInstance,30,addr TempBuff,sizeof TempBuff
.endif
invoke SetDlgItemText,hWnd,1001,addr TempBuff
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hExitBitmap1
.elseif ID==17
invoke GetMenuState,hMenu,107,MF_BYCOMMAND
.if eax==MF_CHECKED
invoke LoadString,hInstance,22,addr TempBuff,sizeof TempBuff
.else
invoke LoadString,hInstance,23,addr TempBuff,sizeof TempBuff
.endif
invoke SetDlgItemText,hWnd,1001,addr TempBuff
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSkipBitmap0
.elseif ID==18
invoke GetMenuState,hMenu,103,MF_BYCOMMAND
.if eax==MF_CHECKED
invoke LoadString,hInstance,20,addr TempBuff,sizeof TempBuff
.else
invoke LoadString,hInstance,21,addr TempBuff,sizeof TempBuff
.endif
invoke SetDlgItemText,hWnd,1001,addr TempBuff
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hLoopBitmap0
.elseif ID==19
.if WindowMode==2
invoke LoadString,hInstance,25,addr TempBuff,sizeof TempBuff
.else
invoke LoadString,hInstance,24,addr TempBuff,sizeof TempBuff
.endif
invoke SetDlgItemText,hWnd,1001,addr TempBuff
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hEQBitmap0
.elseif ID==20
.if RecordMode==TRUE
invoke LoadString,hInstance,28,addr TempBuff,sizeof TempBuff
.else
.if PlayMode==TRUE
invoke LoadString,hInstance,15,addr TempBuff,sizeof TempBuff
.else
invoke LoadString,hInstance,27,addr TempBuff,sizeof TempBuff
.endif
.endif
invoke SetDlgItemText,hWnd,1001,addr TempBuff
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap1
.elseif ID==21
.if WindowMode==1
invoke LoadString,hInstance,26,addr TempBuff,sizeof TempBuff
.else
invoke LoadString,hInstance,39,addr TempBuff,sizeof TempBuff
.endif
invoke SetDlgItemText,hWnd,1001,addr TempBuff
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap0
.endif
.elseif ub==WM_LBUTTONUP
.if ID==10
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPlayBitmap
invoke SendMessage,hWnd,WM_COMMAND,100,hb
.elseif ID==11
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPauseBitmap
invoke SendMessage,hWnd,WM_COMMAND,101,hb
.elseif ID==12
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hStopBitmap
invoke SendMessage,hWnd,WM_COMMAND,102,hb
.elseif ID==13
.if RecordMode==TRUE && PauseState==TRUE
sub CurrPosition,1000
lea ecx,PlayMp3From
invoke wsprintf,offset Buffer,ecx,CurrPosition
invoke mciSendString,offset Buffer,offset MciResult,sizeof MciResult,hWnd
invoke SendMessage,hTrack,TBM_SETPOS,TRUE,CurrPosition
invoke GetDlgItem,hWnd,9
invoke InvalidateRect,eax,NULL,TRUE
.elseif RecordMode==TRUE
invoke SendMessage,hWnd,WM_COMMAND,108,0
.else
invoke SendMessage,hWnd,WM_COMMAND,104,hb
.endif
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPreBitmap
.elseif ID==14
.if RecordMode==TRUE && PauseState==TRUE
add CurrPosition,1000
lea ecx,PlayMp3From
invoke wsprintf,offset Buffer,ecx,CurrPosition
invoke mciSendString,offset Buffer,offset MciResult,sizeof MciResult,hWnd
invoke SendMessage,hTrack,TBM_SETPOS,TRUE,CurrPosition
invoke GetDlgItem,hWnd,9
invoke InvalidateRect,eax,NULL,TRUE
.elseif RecordMode==TRUE
invoke SendMessage,hWnd,WM_COMMAND,109,0
.else
invoke SendMessage,hWnd,WM_COMMAND,105,hb
.endif
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hNextBitmap
.elseif ID==15
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hOpenBitmap
invoke SendMessage,hWnd,WM_COMMAND,99,hb
.elseif ID==16
.if PlayMode==TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hExitBitmap
.else
invoke GetDlgItem,hWnd,20
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap
invoke GetWindowRect,hWnd,addr rect
invoke MoveWindow,hWnd,rect.left,rect.top,288,143,TRUE
invoke GetDlgItem,hWnd,21
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap
mov WindowMode,0
mov RecordMode,FALSE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hExitBitmap1
.endif
mov CurrentTrack,1
invoke SendMessage,hWnd,WM_COMMAND,110,hb
invoke SendMessage,hWnd,WM_COMMAND,100,hb
.elseif ID==17
invoke GetMenuState,hMenu,107,MF_BYCOMMAND
.if eax==MF_CHECKED
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSkipBitmap
invoke CheckMenuItem,hMenu,107,MF_BYCOMMAND or MF_UNCHECKED
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSkipBitmap1
invoke CheckMenuItem,hMenu,107,MF_BYCOMMAND or MF_CHECKED
.endif
.elseif ID==18
invoke GetMenuState,hMenu,103,MF_BYCOMMAND
.if eax==MF_CHECKED
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hLoopBitmap
invoke CheckMenuItem,hMenu,103,MF_BYCOMMAND or MF_UNCHECKED
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hLoopBitmap1
invoke CheckMenuItem,hMenu,103,MF_BYCOMMAND or MF_CHECKED
.endif
.elseif ID==19
invoke GetWindowRect,hWnd,addr rect
.if WindowMode==0
invoke MoveWindow,hWnd,rect.left,rect.top,288,267,TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hEQBitmap1
mov WindowMode,2
.elseif WindowMode==2
invoke MoveWindow,hWnd,rect.left,rect.top,288,143,TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hEQBitmap
mov WindowMode,0
.else
;均衡器
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hEQBitmap1
invoke GetDlgItem,hWnd,21
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap
invoke GetDlgItem,hWnd,20
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap
mov WindowMode,2
.endif
mov RecordMode,FALSE
invoke ShowWindow,hDlg,TRUE
invoke ShowWindow,hScroll,FALSE
invoke ShowWindow,hSongEdit,FALSE
invoke ShowWindow,hList,FALSE
.elseif ID==20
.if PlayMode==TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap
invoke ReleaseCapture
ret
.endif
invoke GetWindowRect,hWnd,addr rect
.if WindowMode==0
invoke MoveWindow,hWnd,rect.left,rect.top,288,267,TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap0
mov WindowMode,3
mov RecordMode,TRUE
jmp @ALLSKIP
.elseif WindowMode==3
invoke MoveWindow,hWnd,rect.left,rect.top,288,143,TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap
mov WindowMode,0
.if ExistFile==TRUE
lea edi,SecondSongWord
mov ecx,sizeof SecondSongWord
mov al,0
rep stosb
.endif
mov RecordMode,FALSE
.else
;均衡器
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap0
invoke GetDlgItem,hWnd,21
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap
invoke GetDlgItem,hWnd,19
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hEQBitmap
mov WindowMode,3
mov RecordMode,TRUE
jmp @ALLSKIP
.endif
jmp @F
@ALLSKIP:
mov RecordMode,TRUE
mov TimeMode,FALSE
invoke GetDlgItem,hWnd,9
invoke InvalidateRect,eax,NULL,TRUE
invoke SendDlgItemMessage,hSongEdit,1000,WM_GETTEXTLENGTH,0,0
cmp eax,0
jnz @F
invoke SetDlgItemText,hSongEdit,1000,offset SongWordFile
invoke GetDlgItem,hSongEdit,1000
invoke SetFocus,eax
@@:
invoke ShowWindow,hList,FALSE
invoke ShowWindow,hSongEdit,TRUE
invoke ShowWindow,hDlg,FALSE
invoke ShowWindow,hScroll,FALSE
.elseif ID==21 ;按下小按钮
invoke GetWindowRect,hWnd,addr rect
.if WindowMode==0
invoke MoveWindow,hWnd,rect.left,rect.top,288,267,TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap1
mov WindowMode,1
.elseif WindowMode==1
invoke MoveWindow,hWnd,rect.left,rect.top,288,143,TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap
mov WindowMode,0
.else
invoke MoveWindow,hWnd,rect.left,rect.top,288,277,TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap1
invoke GetDlgItem,hWnd,19
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hEQBitmap
invoke GetDlgItem,hWnd,20
invoke SendMessage,eax,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap
mov WindowMode,1
.endif
mov RecordMode,FALSE
invoke ShowWindow,hList,TRUE
invoke ShowWindow,hSongEdit,FALSE
invoke ShowWindow,hDlg,FALSE
invoke ShowWindow,hScroll,TRUE
.endif
.if ID>16
invoke SetDlgItemText,hWnd,1001,offset CurrPlayFileName
.endif
invoke ReleaseCapture
.elseif ub==WM_RBUTTONDOWN
.if ID==10
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPlayBitmap
.elseif ID==11
.if PauseState==1
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPauseBitmap2
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPauseBitmap
.endif
.elseif ID==12
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hStopBitmap
.elseif ID==13
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hPreBitmap
.elseif ID==14
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hNextBitmap
.elseif ID==15
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hOpenBitmap
.elseif ID==16
.if PlayMode==TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hExitBitmap0
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hExitBitmap
.endif
.elseif ID==17
invoke GetMenuState,hMenu,107,MF_BYCOMMAND
.if eax==MF_CHECKED
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSkipBitmap1
invoke CheckMenuItem,hMenu,107,MF_BYCOMMAND or MF_CHECKED
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSkipBitmap
invoke CheckMenuItem,hMenu,107,MF_BYCOMMAND or MF_UNCHECKED
.endif
.elseif ID==18
invoke GetMenuState,hMenu,103,MF_BYCOMMAND
.if eax==MF_CHECKED
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hLoopBitmap1
invoke CheckMenuItem,hMenu,103,MF_BYCOMMAND or MF_CHECKED
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hLoopBitmap
invoke CheckMenuItem,hMenu,103,MF_BYCOMMAND or MF_UNCHECKED
.endif
.elseif ID==19
.if WindowMode==2
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hEQBitmap1
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hEQBitmap
.endif
.elseif ID==20
.if RecordMode==TRUE
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap0
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hSongWordBitmap
.endif
.elseif ID==21 ;按下小按钮
.if WindowMode==1
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap1
.else
invoke SendMessage,hb,STM_SETIMAGE,IMAGE_BITMAP,hListBitmap
.endif
.endif
.if ID>16
invoke SetDlgItemText,hWnd,1001,offset CurrPlayFileName
.endif
invoke ReleaseCapture
.endif
invoke GetWindowLong,hb,GWL_USERDATA
invoke CallWindowProc,eax,hb,ub,wb,lb
ret
ButtProc endp
;标题和拖动条
DragProc proc hd,ud,wd,ld
local ps:PAINTSTRUCT
local hdc
local TempBuff[20]:BYTE
.if ud==WM_LBUTTONDOWN
invoke GetParent,hd
invoke SendMessage,eax,WM_NCLBUTTONDOWN,HTCAPTION ,0
.elseif ud==WM_PAINT
invoke BeginPaint,hd,addr ps
mov hdc,eax
invoke GetStockObject,SYSTEM_FONT
invoke SelectObject,hdc,eax
invoke SelectObject,hdc,hBackBrush
invoke Rectangle,hdc,0,0,ALLHEIGHT-59,18
invoke SetBkMode,hdc,TRANSPARENT
invoke SetTextColor,hdc,Black
invoke LoadString,hInstance,11,addr TempBuff,sizeof TempBuff
invoke TextOut,hdc,80,2,addr TempBuff,11
RGB 0,128,180
invoke SetTextColor,hdc,eax
invoke TextOut,hdc,78,0,addr TempBuff,11
invoke EndPaint,hd,addr ps
.endif
invoke GetWindowLong,hd,GWL_USERDATA
invoke CallWindowProc,eax,hd,ud,wd,ld
ret
DragProc endp
ControlProc proc hc,uc,wc,lc
local ps:PAINTSTRUCT
local hdc,ID
invoke GetDlgCtrlID,hc
mov ID,eax
.if uc==WM_LBUTTONDOWN
invoke SetCapture,hc
invoke GetDC,hc
mov hdc,eax
invoke SetBkMode,hdc,TRANSPARENT
invoke SetTextColor,hdc,Green
invoke GetStockObject,DEFAULT_GUI_FONT
invoke SelectObject,hdc,eax
.if ID==2
invoke TextOut,hdc,3,4,offset SonText,2
.elseif ID==3
invoke TextOut,hdc,3,4,offset SonText+2,2
.else
invoke TextOut,hdc,5,0,offset SonText+4,1
.endif
invoke ReleaseDC,hc,hdc
.elseif uc==WM_LBUTTONUP
.if ID==2
invoke SendMessage,hWnd,WM_USER +5,0,WM_RBUTTONUP
.elseif ID==3
invoke SendMessage,hWnd,WM_CLOSE,0,0
.else
invoke ShowWindow,hWnd,SW_MINIMIZE
.endif
invoke InvalidateRect,hc,NULL,TRUE
invoke ReleaseCapture
.elseif uc==WM_RBUTTONDOWN
invoke InvalidateRect,hc,NULL,TRUE
invoke ReleaseCapture
.elseif uc==WM_PAINT
invoke BeginPaint,hc,addr ps
mov hdc,eax
invoke SelectObject,hdc,hBackBrush
invoke Rectangle,hdc,0,0,18,18
invoke SetBkMode,hdc,TRANSPARENT
invoke GetStockObject,DEFAULT_GUI_FONT
invoke SelectObject,hdc,eax
RGB 150,150,150
invoke SetTextColor,hdc,eax
.if ID==2
invoke TextOut,hdc,3,4,offset SonText,2
.elseif ID==3
invoke TextOut,hdc,3,4,offset SonText+2,2
.else
invoke TextOut,hdc,5,0,offset SonText+4,1
.endif
invoke EndPaint,hc,addr ps
.endif
invoke GetWindowLong,hc,GWL_USERDATA
invoke CallWindowProc,eax,hc,uc,wc,lc
ret
ControlProc endp
;状态显示过程
StaticProc proc hs,us,ws,ls
local ps:PAINTSTRUCT
local hdc,StrLength
.if us==WM_SETTEXT
lea edi,StaticStr
mov ecx,sizeof StaticStr
mov al,0
rep stosb
invoke lstrcpy,offset StaticStr,ls
invoke InvalidateRect,hs,NULL,TRUE
.elseif us==WM_PAINT
invoke BeginPaint,hs,addr ps
mov hdc,eax
invoke GetStockObject,DEFAULT_GUI_FONT
invoke SelectObject,hdc,eax
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc,eax
invoke SelectObject,hdc,hBackBrush2
invoke Rectangle,hdc,0,0,204,19
invoke SelectObject,hdc,hYJBrush
invoke RoundRect,hdc,0,0,204,19,20,20
.if Mp3State>0
invoke SelectObject,hdc,hYJBrush0
invoke RoundRect,hdc,1,1,203,18,20,20
.endif
invoke SetBkMode,hdc,TRANSPARENT
invoke lstrlen,offset StaticStr
mov StrLength,eax
cmp StrLength,30
jle @F
mov StrLength,32
mov edi,offset StaticStr
add edi,29
mov al,0
stosb
invoke lstrcat,offset StaticStr,offset EndStr
@@:
invoke SetTextColor,hdc,Black
invoke TextOut,hdc,8,4,offset StaticStr,StrLength
invoke SetTextColor,hdc,Green
invoke TextOut,hdc,7,3,offset StaticStr,StrLength
invoke EndPaint,hs,addr ps
.else
invoke GetWindowLong,hs,GWL_USERDATA
invoke CallWindowProc,eax,hs,us,ws,ls
.endif
ret
StaticProc endp
;时间显示窗口
TimeProc proc htp,utp,wtp,ltp
local ps:PAINTSTRUCT
local hdc
local rect:RECT
local TempBuff[100]:BYTE
.if utp==WM_LBUTTONDOWN
.if RecordMode==TRUE
mov TimeMode,FALSE
invoke LoadString,hInstance,42,offset MciResult,sizeof MciResult
invoke SetDlgItemText,hWnd,1001,offset MciResult
.else
.if TimeMode==FALSE
mov TimeMode,TRUE
.else
mov TimeMode,FALSE
.endif
invoke InvalidateRect,htp,NULL,TRUE
.endif
.elseif utp==WM_PAINT
invoke BeginPaint,htp,addr ps
mov hdc,eax
invoke GetStockObject,SYSTEM_FONT
invoke SelectObject,hdc,eax
.if Mp3State>0
invoke SelectObject,hdc,hYJBrush0
.else
invoke SelectObject,hdc,hYJBrush
.endif
invoke Rectangle,hdc,0,0,70,46
invoke SetBkMode,hdc,TRANSPARENT
invoke SetTextColor,hdc,Green
.if Mp3State>0
;显示当前时间
.if TimeMode==FALSE
mov eax,CurrPosition
.else
mov eax,TotalLength
sub eax,CurrPosition
.endif
invoke wsprintf,offset MciResult,offset tempnum,eax
invoke lstrlen,offset MciResult
push eax
lea edi,TimeBuffer
mov al,0
mov ecx,sizeof TimeBuffer
rep stosb
pop eax
cmp eax,3
jle OK
sub eax,4
invoke szLeft,offset MciResult,offset TimeBuffer,eax
OK:
invoke StrToDword,offset TimeBuffer
.if RecordMode==FALSE
add eax,ShowSleep
cmp eax,0
jg @F
mov eax,0
@@:
.endif
.if eax>59
mov edx,0
mov ecx,60
div ecx
.if eax<10 && edx <10
invoke wsprintf,offset TimeBuffer,offset TimeShow,offset ZeroStr,eax,offset ZeroStr,edx
.elseif eax<10 && edx>9
invoke wsprintf,offset TimeBuffer,offset TimeShow,offset ZeroStr,eax,offset EmptyStr,edx
.elseif eax>9 && edx<10
invoke wsprintf,offset TimeBuffer,offset TimeShow,offset EmptyStr,eax,offset ZeroStr,edx
.elseif eax>9 && edx>9
invoke wsprintf,offset TimeBuffer,offset TimeShow,offset EmptyStr,eax,offset EmptyStr,edx
.endif
.else
.if eax>9
invoke wsprintf,offset TimeBuffer,offset TimeShow,offset ZeroStr,0,offset EmptyStr,eax
.else
invoke wsprintf,offset TimeBuffer,offset TimeShow,offset ZeroStr,0,offset ZeroStr,eax
.endif
.endif
.if Mp3State==1
invoke TextOut,hdc,15,3,offset PlayStr,sizeof PlayStr-1
.else
invoke TextOut,hdc,15,3,offset PauseStrn,sizeof PauseStrn-1
.endif
.elseif Mp3State==0
invoke TextOut,hdc,15,3,offset StopStrn,sizeof StopStrn-1
.endif
cmp TimeMode,TRUE
jnz @F
invoke TextOut,hdc,26,4,offset SubString,sizeof SubString-1
invoke TextOut,hdc,25,3,offset SubString,sizeof SubString-1
@@:
invoke SetTextColor,hdc,Black
invoke TextOut,hdc,31,4,offset TimeBuffer,5
invoke SetTextColor,hdc,Green
invoke TextOut,hdc,30,3,offset TimeBuffer,5
;invoke GetStockObject,DEFAULT_GUI_FONT
invoke SelectObject,hdc,SmallFont
mov rect.top,32
mov rect.left,0
mov rect.bottom,45
mov rect.right,65
invoke wsprintf,addr TempBuff,offset tempstrs,ShowSleep,WordShowTime
;invoke TextOut,hdc,30,31,addr TempBuff,4
invoke DrawText,hdc,addr TempBuff,-1,addr rect,DT_RIGHT
invoke EndPaint,htp,addr ps
.else
invoke GetWindowLong,htp,GWL_USERDATA
invoke CallWindowProc,eax,htp,utp,wtp,ltp
.endif
ret
TimeProc endp
EQProc proc heq,ueq,weq,leq
local ps:PAINTSTRUCT
local hdc,TempNum
local rect:RECT
.if ueq==WM_INITDIALOG
;===========================================================================================================
;子类化所有TrackBar
;===========================================================================================================
mov TempNum,1010
@@:
invoke GetDlgItem,heq,TempNum
push eax
invoke SetWindowLong,eax,GWL_WNDPROC,offset EQConProc
pop ecx
invoke SetWindowLong,ecx,GWL_USERDATA,eax
inc TempNum
cmp TempNum,1019
jle @B
;液晶显示
invoke GetDlgItem,heq,10
push eax
invoke SetWindowLong,eax,GWL_WNDPROC,offset WaveShowProc
pop ecx
invoke SetWindowLong,ecx,GWL_USERDATA,eax
.elseif ueq==WM_CLOSE
invoke EndDialog,heq,FALSE
.elseif ueq==WM_PAINT
invoke BeginPaint,heq,addr ps
mov hdc,eax
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc,eax
invoke SelectObject,hdc,hBackBrush2
invoke Rectangle,hdc,0,0,280,115
invoke GetStockObject,BLACK_BRUSH
invoke SelectObject,hdc,eax
invoke RoundRect,hdc,0,0,280,115,115,115
invoke EndPaint,heq,addr ps
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
EQProc endp
WaveShowProc proc hws,uws,wws,lws
local ps:PAINTSTRUCT
local hdc
local rect:RECT
.if uws==WM_PAINT
invoke BeginPaint,hws,addr ps
mov hdc,eax
invoke GetStockObject,DEFAULT_GUI_FONT
invoke SelectObject,hdc,eax
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc,eax
invoke GetStockObject,BLACK_BRUSH
invoke SelectObject,hdc,eax
invoke Rectangle,hdc,0,0,185,28
invoke SelectObject,hdc,hListBrush
invoke RoundRect,hdc,0,0,185,25,25,25
invoke SetBkMode,hdc,TRANSPARENT
invoke SetTextColor,hdc,Black
invoke TextOut,hdc,32,7,offset NotEq,sizeof NotEq-1
invoke SetTextColor,hdc,Green
invoke TextOut,hdc,30,5,offset NotEq,sizeof NotEq-1
invoke EndPaint,hws,addr ps
.else
invoke GetWindowLong,hws,GWL_USERDATA
invoke CallWindowProc,eax,hws,uws,wws,lws
.endif
ret
WaveShowProc endp
;EQ均衡器过程
EQConProc proc heqc,ueqc,weqc,leqc
local ps:PAINTSTRUCT
local hdc
local rect:RECT
.if ueqc==WM_PAINT
invoke BeginPaint,heqc,addr ps
mov hdc,eax
invoke GetStockObject,BLACK_BRUSH
invoke SelectObject,hdc,eax
invoke GetStockObject,NULL_PEN
invoke SelectObject,hdc,eax
invoke Rectangle,hdc,0,0,30,130
invoke SelectObject,hdc,hBackBrush0
invoke Rectangle,hdc,6,1,13,129
invoke SelectObject,hdc,hPen
invoke SelectObject,hdc,hBackBrush1
invoke SendMessage,heqc,TBM_GETTHUMBRECT,0,addr rect
invoke Rectangle,hdc,rect.left,rect.top,rect.right,rect.bottom
invoke EndPaint,heqc,addr ps
.endif
invoke GetWindowLong,heqc,GWL_USERDATA
invoke CallWindowProc,eax,heqc,ueqc,weqc,leqc
ret
EQConProc endp
SongEditProc proc hse,use,wse,lse
local TempNum,hdc,ps:PAINTSTRUCT,cmpcolor:COMPCOLOR,TempBuff[50]:BYTE
.if use==WM_COMMAND
mov eax,wse
.if ax==1
.if Mp3State==0
invoke SendMessage,hWnd,WM_COMMAND,100,0
.endif
invoke wsprintf,addr TempBuff,offset SaveSongWord,offset TimeBuffer
invoke SendDlgItemMessage,hse,1000,EM_REPLACESEL,TRUE,addr TempBuff
invoke IsDlgButtonChecked,hse,4
.if PauseState==TRUE && eax==BST_CHECKED
invoke SendMessage,hWnd,WM_COMMAND,101,0
.endif
invoke GetDlgItem,hse,1000
invoke SetFocus,eax
.elseif ax==2
invoke exist,offset CurrFileName
.if eax!=TRUE
invoke SendMessage,hse,WM_COMMAND,3,0
ret
.else
jmp @F
.endif
.elseif ax==3
lea eax,LrcFileFilter
mov ofn.lpstrFilter,eax
invoke LoadString,hInstance,11,offset TempBuffer,sizeof TempBuffer
mov ofn.lpstrTitle,offset TempBuffer
mov ofn.lpstrFile,offset CurrFileName
mov ofn.nMaxFile,sizeof CurrFileName
invoke GetSaveFileName,offset ofn
.if eax!=0
jmp @F
.endif
.elseif ax==5
invoke exist,offset CurrFileName
.if eax!=TRUE
invoke LoadString,hInstance,12,addr TempBuff,sizeof TempBuff
invoke wsprintf,offset TempBuffer,addr TempBuff,offset CurrFileName
invoke MessageBox,hse,addr TempBuffer,0,MB_ICONWARNING
.else
invoke LoadString,hInstance,17,addr TempBuff,sizeof TempBuff
invoke wsprintf,offset TempBuffer,addr TempBuff,offset CurrFileName
invoke MessageBox,hse,addr TempBuffer,0,MB_ICONWARNING or MB_OKCANCEL
.if eax==IDOK
invoke DeleteFile,offset CurrFileName
invoke LoadString,hInstance,45,addr TempBuff,sizeof TempBuff
invoke wsprintf,offset TempBuffer,addr TempBuff,offset CurrFileName
invoke MessageBox,hse,addr TempBuffer,0,MB_ICONWARNING
.endif
.endif
.endif
ret
@@:
lea edi,Buffer
mov ecx,sizeof Buffer
mov al,0
rep stosb
invoke CreateFile,offset CurrFileName,GENERIC_READ or GENERIC_WRITE,0,NULL,CREATE_ALWAYS,0,0
cmp hFile,INVALID_HANDLE_VALUE
jnz @F
invoke LoadString,hInstance,46,addr TempBuff,sizeof TempBuff
invoke wsprintf,offset TempBuffer,addr TempBuff,offset CurrFileName
invoke MessageBox,hse,addr TempBuffer,0,MB_ICONERROR
ret
@@:
mov hFile,eax
invoke SendDlgItemMessage,hSongEdit,1000,WM_GETTEXT,sizeof Buffer,offset Buffer
invoke WriteFile,hFile,offset Buffer,eax,offset ReadLoad,NULL
invoke CloseHandle,hFile
invoke LoadString,hInstance,19,addr TempBuff,sizeof TempBuff
invoke wsprintf,offset TempBuffer,addr TempBuff,offset CurrFileName
invoke MessageBox,hse,addr TempBuffer,0,MB_ICONINFORMATION
.elseif use==WM_CLOSE
invoke EndDialog,hse,FALSE
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
SongEditProc endp