Article ID: 141060
Article Last Modified on 11/18/2003
#include <windows.h>
int FAR PASCAL LibMain(HANDLE hInstance, WORD wDataSeg, WORD wHeapSize,
LPSTR lpszCmdLine)
{
if (wHeapSize > 0)
UnlockData(0);
return 1;
}
Sound1 WAVE c:\windows\ding.wav
Sound2 WAVE c:\windows\chimes.wav
Declare Function sndPlaySound Lib "mmsystem.dll" (ByVal lpRes As Any, ByVal wflags As Integer) As Integer Declare Function LoadLibrary Lib "kernel" (ByVal lpLibFileName As String) As Integer Declare Function FindResource Lib "kernel" (ByVal hInstance As Integer, ByVal lpname As String, ByVal lpType As Any) As Integer Declare Function LoadResource Lib "kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer) As Integer Declare Function LockResource Lib "kernel" (ByVal hResData As Integer) As Long Declare Function FreeResource Lib "kernel" (ByVal hResData As Integer) As Integer Declare Sub FreeLibrary Lib "kernel" (ByVal hInstance As Integer) Const SND_MEMORY = 4
Dim hInstance As Integer
Dim hResInfo As Integer
Dim hRes As Integer
Dim lpRes As Long
Dim iReturn As Integer
hInstance = LoadLibrary("c:\wavedll.dll")
hResInfo = FindResource(hInstance, "Sound1", "WAVE")
hRes = LoadResource(hInstance, hResInfo)
lpRes = LockResource(hRes)
iReturnVal = sndPlaySound(lpRes, SND_MEMORY)
iReturnVal = FreeResource(hRes)
FreeLibrary(hInstance)
Additional query words: 3.00 vb3 vbasic
Keywords: kbmm KB141060