| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 815 人关注过本帖
标题:请指点迷津!感激不劲!
只看楼主 加入收藏
justholdon
Rank: 1
等 级:新手上路
威 望:2
帖 子:69
专家分:0
注 册:2007-4-23
收藏
 问题点数:0 回复次数:0 
请指点迷津!感激不劲!

我从网上找到的 这个程序有错误!编译事是两个!请大家帮我弄一下啊!最好装载一个文件夹里,在个我传过来!
我想学学播放音乐的代码!我是初学者,真的很想学!拜托大家了啊!
这里要是有东北大学的,我就去拜师!哈哈·


.386
.model flat, stdcall
option casemap :none

include h:/masm32/include/windows.inc
include h:/masm32/include/user32.inc
includelib h:/masm32/lib/user32.lib
include h:/masm32/include/kernel32.inc
includelib h:/masm32/lib/kernel32.lib
include h:/masm32/include/Gdi32.inc
includelib h:/masm32/lib/Gdi32.lib
include h:/masm32/include/winmm.inc
includelib h:/masm32/lib/winmm.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Equ 等值定义
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
IDR_MID1 equ 1000
IDI_ICON1 equ 102
IDD_DIALOG1 equ 103
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 数据段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data?
hInstance dd ?
hWinMain dd ?
hDevice dd ?
szFile db MAX_PATH dup (?)

.const
szResType db 'MID',0
szDevice db 'Sequencer',0
szFileName db '~PA',0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 代码段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_PlayMID proc
local @stMCIOpen:MCI_OPEN_PARMS
local @stMCIPlay:MCI_PLAY_PARMS
local @hResInfo,@dwResSize,@lpRes
local @hFile,@dwTemp

;====================================================
;载入资源
invoke FindResource,hInstance,IDR_MID1,addr szResType
mov @hResInfo,eax
invoke SizeofResource,hInstance,@hResInfo
mov @dwResSize,eax
invoke LoadResource,hInstance,@hResInfo
invoke LockResource,eax
mov @lpRes,eax
;建立文件
invoke GetTempPath,MAX_PATH,addr szFile
invoke lstrcat,addr szFile,addr szFileName
invoke MessageBox,NULL,addr szFile,addr szFile,MB_OK
invoke CreateFile,addr szFile,GENERIC_WRITE,FILE_SHARE_READ,\
NULL,Create_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
mov @hFile,eax
invoke WriteFile,@hFile,@lpRes,@dwResSize,addr @dwTemp,NULL
invoke CloseHandle,@hFile
;====================================================
mov @stMCIOpen.lpstrDeviceType,offset szDevice
mov @stMCIOpen.lpstrElementName,offset szFile
invoke mciSendCommand,0,MCI_OPEN,MCI_OPEN_TYPE or MCI_OPEN_ELEMENT,addr @stMCIOpen
mov eax,@stMCIOpen.wDeviceID
mov hDevice,eax
mov eax,hWinMain
mov @stMCIPlay.dwCallback,eax
invoke mciSendCommand,hDevice,MCI_PLAY,MCI_NOTIFY,addr @stMCIPlay
;====================================================

ret

_PlayMID endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_CloseMID proc
local @stMCIStop:MCI_GENERIC_PARMS

mov eax,hWinMain
mov @stMCIStop.dwCallback,eax
invoke mciSendCommand,hDevice,MCI_STOP,MCI_NOTIFY,addr @stMCIStop
invoke mciSendCommand,hDevice,MCI_CLOSE,MCI_NOTIFY,addr @stMCIStop
invoke DeleteFile,addr szFile

ret
_CloseMID endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ProcDlgMain proc uses ebx edi esi hWnd,wMsg,wParam,lParam

mov eax,wMsg
.if eax == WM_CLOSE
invoke _CloseMID
invoke EndDialog,hWnd,NULL
.elseif eax == WM_INITDIALOG
mov eax,hWnd
mov hWinMain,eax
invoke LoadIcon,hInstance,IDI_ICON1
invoke SendMessage,hWnd,WM_SETICON,ICON_BIG,eax
invoke _PlayMID
.elseif eax == WM_COMMAND

.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret

_ProcDlgMain endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,offset _ProcDlgMain,NULL
invoke ExitProcess,NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end start

搜索更多相关主题的帖子: include windows 东北大学 感激 
2007-10-18 14:20
快速回复:请指点迷津!感激不劲!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028187 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved