0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

C言語(Windows API)を使って7以降のWindowsで音付きのアイコンのないダイアログを表示したい

Posted at

Windows Vistaまではアイコンのないダイアログで一般の警告音が鳴っていました。
Windows 7以降は鳴らなくなりました。
それでも、音付きのアイコンのないダイアログをC言語(Windows API)で表示させてみます。

非常に単純ですが、MessageBox関数を呼ぶ前にMessageBeep関数で一般の警告音を鳴らすだけです。
音にこだわる人の自己満足ですが…

NoIconDialogWithSound.c
# include <Windows.h>

int WINAPI WinMain(HINSTANCE hI, HINSTANCE hP, LPSTR lpC, int nC)
{
	MessageBeep(MB_OK);
	MessageBox(NULL, "一般の警告音が鳴ります。", "音付きのアイコンのないダイアログ", MB_OK);

	return 0;
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?