Autor Beitrag
mambo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Do 05.09.02 16:26 
Wie kann ich einen Warnton über den PC-Piepser ausgeben ???

Danke
Heinz
JeanvanHees
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Do 05.09.02 16:33 
Probiers mal hiermit.
Du haßt aber die port.dll nötig. Wenn du auf google nach port.dll suchst wirst du ihm warscheinlich finden.
Ich kann ihm dir auch schicken....Laß es mir wissen.
Tschußjen :)


Code:
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
unit Ton1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics,
  Controls, Forms, Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Ton1: TButton; Ton2: TButton;
    procedure Ton1Click(Sender: TObject);
    procedure Ton2Click(Sender: TObject);
end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure OUTPORT (adr: Word; Wert: Word);
    stdcall; external 'PORT.dll';

function INPORT (adr: Word):Integer;
    stdcall; external 'PORT.DLL';

procedure DELAY (ms: Word);
    stdcall; external 'PORT.DLL';

procedure TForm1.Ton1Click(Sender: TObject);
var n, t: Integer;
begin
  For n := 1 to 100 do begin
    OutPort (97, (InPort (97) OR 2));
    For t := 1 to 10000 Do;
    OutPort (97, (InPort (97) AND 253));
    For t := 1 to 10000 Do;
  end;
end;

procedure TForm1.Ton2Click(Sender: TObject);
var n: Integer;
begin
  For n := 1 to 100 do begin
    OutPort (97, (InPort (97) OR 2));
    Delay (1);
    OutPort (97, (InPort (97) AND 253));
    Delay (1);
  end;
end;

end.

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
SvenAbeln
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 334
Erhaltene Danke: 3



BeitragVerfasst: Do 05.09.02 17:15 
oder wenn du nur einen Ton ausgeben willst
geht es auch einfacher

Beep; :lol:

oder in der Windows-API gibt es
ausblenden Quelltext
1:
MessageBeep					


die verlangt aber einen Parameter,
habe aber gerade keine API Hilfe zur Hand muß mal
selber nachschauen was diese Funktion alles kann.
(sie gibt glaube ich auch verschiedene Töne aus)
Albanac
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Sa 28.09.02 13:41 
-> von der hilfe
The MessageBeep function plays a waveform sound. The waveform sound for each sound type is identified by an entry in the [sounds] section of the registry.

BOOL MessageBeep(

UINT uType // sound type
);

Parameters

uType

Specifies the sound type, as identified by an entry in the [sounds] section of the registry. This parameter can be one of the following values:

Value Sound
0xFFFFFFFF Standard beep using the computer speaker
MB_ICONASTERISK SystemAsterisk
MB_ICONEXCLAMATION SystemExclamation
MB_ICONHAND SystemHand
MB_ICONQUESTION SystemQuestion
MB_OK SystemDefault

:?: andere Frage: ich möchte standart beep machen, wie sieht ein code beispiel dazu aus?
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 28.09.02 19:47 
Hi,

also ich würd's mit
ausblenden Quelltext
1:
Windows.Beep(Freq,Dauer);					

machen.

Mal nen beispiel von mir:
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
  Windows.Beep(1100,200);
Windows.Beep(10000,10);
  Windows.Beep(1200,200);
Windows.Beep(10000,10);
  Windows.Beep(1300,200);
Windows.Beep(10000,10);
  Windows.Beep(1400,200);
Windows.Beep(10000,10);
  Windows.Beep(1500,400);
Windows.Beep(10000,10);
  Windows.Beep(1500,400);
Windows.Beep(10000,10);
  Windows.Beep(1600,200);
Windows.Beep(10000,10);
  Windows.Beep(1600,200);
Windows.Beep(10000,10);
  Windows.Beep(1600,200);
Windows.Beep(10000,10);
  Windows.Beep(1600,200);
Windows.Beep(10000,10);
  Windows.Beep(1500,400);
Windows.Beep(10000,10);
  Windows.Beep(1600,200);
Windows.Beep(10000,10);
  Windows.Beep(1600,200);
Windows.Beep(10000,10);
  Windows.Beep(1600,200);
Windows.Beep(10000,10);
  Windows.Beep(1600,200);
Windows.Beep(10000,10);
  Windows.Beep(1500,400);
Windows.Beep(10000,10);
  Windows.Beep(1400,200);
Windows.Beep(10000,10);
  Windows.Beep(1400,200);
Windows.Beep(10000,10);
  Windows.Beep(1400,200);
Windows.Beep(10000,10);
  Windows.Beep(1400,200);
Windows.Beep(10000,10);
  Windows.Beep(1300,400);
Windows.Beep(10000,10);
  Windows.Beep(1300,400);
Windows.Beep(10000,10);
  Windows.Beep(1200,200);
Windows.Beep(10000,10);
  Windows.Beep(1200,200);
Windows.Beep(10000,10);
  Windows.Beep(1200,200);
Windows.Beep(10000,10);
  Windows.Beep(1200,200);
Windows.Beep(10000,10);
  Windows.Beep(1100,400);


probiert's mal aus ;)

Au'revoir,
Aya