|
楼主 |
发表于 2014-7-29 16:36:52
|
显示全部楼层
includelib winmm.lib;
include gdi32.inc
includelib gdi32.lib
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib
include gdi32.inc
includelib gdi32.lib
include comctl32.inc
includelib comctl32.lib
DLG_MAIN equ 1000h
ICO_MAIN equ 2000h
.data?
hInstance dd ?;定义模块句柄
dwReSize dd ?
hDevice dd ?
hWinMain dd ?
DeviceIDC dd ?
.const
szDevice db " CDAUDIO",0;CDAUDIO
.code
_procPlay proc
local @stMCIOpen:MCI_OPEN_PARMS
LOCAL @stMCIPlay:MCI_PLAY_PARMS
invoke RtlZeroMemory,addr @stMCIOpen,sizeof @stMCIOpen
mov @stMCIOpen.lpstrDeviceType,offset szDevice
invoke mciSendCommand,NULL,MCI_OPEN,MCI_OPE研究了一晚上终于可以让他关闭了,源码附上 封贴
.386
.model flat,stdcall
option casemap:none
include windows.inc
include winmm.incN_TYPE,addr @stMCIOpen
;mciSendCommand发送消息给MCI设备
mov eax,@stMCIOpen.wDeviceID;;*******mov返回的设备名称
push eax
pop DeviceIDC;*****传给DeviceIDC
invoke mciSendCommand,MCI_ALL_DEVICE_ID,MCI_SET,MCI_SET_DOOR_OPEN,NULL
call _CloseMP3
ret
_procPlay endp
;************************************************* 关闭CD部分
_CloseMP3 proc _hwnd
local @stMCIClose:MCI_GENERIC_PARMS
invoke RtlZeroMemory ,addr @stMCIClose,sizeof @stMCIClose
mov @stMCIClose.dwCallback,NULL
invoke mciSendCommand, DeviceIDC ,MCI_SET,MCI_SET_DOOR_CLOSED,0
invoke mciSendCommand,DeviceIDC ,MCI_CLOSE,MCI_WAIT,0
ret
_CloseMP3 endp
;*********************************
;***********主程序部分*********
start:
call _procPlay
invoke ExitProcess,NULL
end start |
|