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 5 years have passed since last update.

c++ builder XE4, 10.2 Tokyo > sound > beep音を鳴らす > Beep();

Last updated at Posted at 2015-11-22
動作確認
C++ Builder XE4
Rad Studio 10.2 Tokyo Update 2 (追記: 2017/12/27)

Beep音の鳴らし方。

参考 http://www.geocities.jp/asumaroyuumaro/program/tips/beep.html

Unit1.cpp
void __fastcall TForm1::Button1Click(TObject *Sender)
{
	Beep(); // 標準Beep音

	Sleep(1000);
	MessageBeep(MB_ICONASTERISK);
	Sleep(1000);
	MessageBeep(MB_ICONEXCLAMATION); //警告
	Sleep(1000);
	MessageBeep(MB_ICONHAND); //システムエラー
	Sleep(1000);
	MessageBeep(MB_ICONQUESTION); //問い合わせ
	Sleep(1000);
	MessageBeep(MB_OK); //一般の警告音
}

参考ページには
messageBeep()と小文字のm始まりの関数名だが、XE4ではエラーとなった。
MessageBeep()と大文字のM始まりの関数名にしたら動いた。


(追記 2016/01/07)

自分が聞いた音の感じ

  • MB_ICONEXCLAMATION > やわらかい音
  • MB_ICONHAND > 重い音
  • MB_OK > 軽い音
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?