Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[8464] Re:[질문]시스템 비프음을 어떻게 사용하나요?
조준회 [] 1064 읽음    2002-11-12 13:27
빌더의 헬프에서 퍼왔씁니다.
-----------------------------------------------------------
Generates a standard beep using the computer speaker.

Unit

Sysutils

Category

miscellaneous routines

extern PACKAGE void __fastcall Beep(void);

Description

Beep calls the Windows API MessageBeep.




컴투맨 님이 쓰신 글 :
: 에러 체크나 알림을 하기 위해서 스피커를 이용하지 않고,
: 컴퓨터 시스템비프음을 사용하고 싶은데 방법을 모르겠습니다.
:
: 아시는 분은 꼭 좀 가르쳐 주세요^^
:
: 아래는 유사한 소스를 구해 해봤는데 에러가 나더군요.
: 함 살펴봐 주세요...
:
: <소스>
: unit Unit1;
:
: interface
:
: uses
: Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
: StdCtrls;
:
: type
: TForm1 = class(TForm)
:   Button1: TButton;
:   procedure Button1Click(Sender: TObject);
: private
:   { Private declarations }
: public
:   { Public declarations }
: end;
:
: var
: Form1: TForm1;
:
: implementation
:
: {$R *.DFM}
:
: procedure BeepStart(pitch:SMALLINT);
: asm
:   mov     bx,  pitch
:   mov     ax,  34DDh
:   mov     dx,  0012h
:   cmp     dx,  bx
:   jnb     @stop
:   div     bx
:   mov     bx,  ax
:   in      al,  61h
:   test    al,  3
:   jne     @j1
:   or      al,  3
:   out     61h, al
:   mov     al,  0B6h
:   out     43h, al
: @j1:
:   mov     al,  bl
:   out     42h, al
:   mov     al,  bh
:   out     42h, al
: @stop:
: end;
:
: // Sound 중지
: procedure BeepStop;
: asm
: in      al,61H
: and     al, 0fcH
: out     61H, al
: end;
:
:
: procedure TForm1.Button1Click(Sender: TObject);
: begin
: BeepStart(100);  // 주파수 싸이클수(양수값만 허용), 높을수록 저음
: Sleep(100);      // (delay) 1초간 지연
: BeepStop;       
: end;
:
: end.

+ -

관련 글 리스트
8463 [질문]시스템 비프음을 어떻게 사용하나요? 컴투맨 929 2002/11/12
9283     Re:[질문]시스템 비프음을 어떻게 사용하나요? 오군 1068 2002/11/12
8467     Re:[답변] 해결책 입니다. 박종민.BacTeria 1140 2002/11/13
8464     Re:[질문]시스템 비프음을 어떻게 사용하나요? 조준회 1064 2002/11/12
8465         Re:Re:[질문]시스템 비프음을 어떻게 사용하나요? 컴투맨 2277 2002/11/12
8466             Re:Re:Re:[질문]시스템 비프음을 어떻게 사용하나요? 김백일 1283 2002/11/12
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.