File:  [WindowsNT SDKs] / mstools / samples / playsnd / res.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 18:23:55 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: ntsdk-nov-1993, ntsdk-jul-1993, HEAD
Microsoft Windows NT Build 511 (SDK Final Release) 07-24-1993

/*
    res.c

    Resource menu stuff

*/

#include <stdlib.h>
#include <windows.h>
#include "PlaySnd.h"


void Resource(DWORD wParam)
{
    char *name;
    DWORD dwFlags;

    switch (wParam) {
    case IDM_DING:
        name = "ding";
        break;

    case IDM_SIREN:
        name = "siren";
        break;

    case IDM_LASER:
        name = "laser";
        break;

    default:
        name = NULL;
        Error("Don't know how to play that");
        break;
    }
	if (bResourceID) {
		name = (LPSTR)wParam;
	}

    if (name) {
        dwFlags = SND_RESOURCE;

        if (bSync) {
			WinAssert(!SND_SYNC);
		} else {
			dwFlags |= SND_ASYNC;
		}

        if (bNoWait) dwFlags |= SND_NOWAIT;
        if (!PlaySound(name, ghModule, dwFlags | bNoDefault)) {
			if (HIWORD(name)) {
				Error("Failed to play resource: %s  (by name)", name);
			} else {
				Error("Failed to play resource: %x  (by ID)", name);
			}
        }
    }
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.