Category : C Source Code
Archive   : WNDSND.ZIP
Filename : WNDPROC.C
Output of file : WNDPROC.C contained in archive : WNDSND.ZIP
/* global stuff */
extern HWND hwnd;
extern HWND soundhwnd;
extern HANDLE hInst;
/* if no multimedia support, this has the procaddress of sndPlaySound */
FARPROC playsampledsound;
/* other stuff */
char szUntitled[]= "mainclass";
char szAppname[]= "main";
#include "wndproc.pro"
int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR l, int nCmdShow)
{
MSG msg;
DWORD a;
HANDLE soundhandle;
hInst= hInstance;
if (!hPrevInstance)
{
int registered= 0;
WNDCLASS wndclass;
wndclass.style = WS_SYSMENU | CS_BYTEALIGNCLIENT | WS_CLIPCHILDREN;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(hInstance, "main");
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = GetStockObject(BLACK_BRUSH);
wndclass.lpszMenuName = szAppname;
wndclass.lpszClassName = szUntitled;
if (!(registered= RegisterClass(&wndclass)))
return(NULL);
}
if (!(hwnd= CreateWindow(szUntitled, szUntitled,
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL)))
return(NULL);
/* Error1Message("Create sound window: %X.\n", hwnd); */
if ((soundhandle= GetModuleHandle("MMSYSTEM") ) != 0)
LoadSoundSystem(hwnd, hInst, soundhandle);
else
soundhwnd= hwnd;
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
main();
if (soundhandle)
UnloadSoundSystem();
DestroyWindow(hwnd);
return(0); // return msg.wParam;
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/