AfxBeginThread((AFX_THREADPROC)sound,NULL,THREAD_PRIORITY_NORMAL); |
HRSRC FindResource( HMODULE hModule, // module handle LPCTSTR lpName, // resource name LPCTSTR lpType // resource type ) |
HGLOBAL LoadResource( HMODULE hModule, // module handle HRSRC hResInfo // resource handle ); |
LPVOID pv=LockResource() |
UINT CPlaySoundView::sound(LPVOID pParam) { HINSTANCE h=AfxGetInstanceHandle(); HRSRC hr=FindResource(h,\"IDW\",\"WAVE\"); HGLOBAL hg=LoadResource(h,hr); LPSTR lp=(LPSTR)LockResource(hg); sndPlaySound(lp,SND_MEMORY|SND_SYNC); FreeResource(hg); return 0; } |