window 编程 -- Beep函数之祝你生日快乐!

#include 

int main()
{
	MessageBeep(MB_ICONHAND);
	MessageBeep(MB_ICONEXCLAMATION);
	MessageBeep(MB_ICONASTERISK);
	//system("pause");
	while (1) {
#if 1
		Beep(523, 200);
		Beep(523, 200);
		Beep(578, 400);
		Beep(523, 400);
		Beep(698, 400);
		Beep(659, 800);

		Beep(523, 200);
		Beep(523, 200);
		Beep(578, 400);
		Beep(523, 400);
		Beep(784, 400);
		Beep(698, 800);

		Beep(523, 200);
		Beep(523, 200);
		Beep(1046, 400);
		Beep(880, 400);
		Beep(698, 400);

		Beep(659, 400);
		Beep(578, 400);

		Beep(932, 200);
		Beep(932, 200);
		Beep(880, 400);
		Beep(698, 400);
		Beep(784, 400);
		Beep(698, 800);
#endif
		Beep(10000, 1000);
	}
	return 0;
}

原文链接:https://www.cnblogs.com/nowroot/p/12416630.html

你可能感兴趣的:(Win32+MFC)