Autor Beitrag
Adam Weishaupt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Fr 20.06.03 17:13 
Hi!

Ich wollte ein Programm schreiben, dass auf ButtonClick die beiden Mausbuttons austauscht. Das geht über die Registry:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
var
  reg: TRegistry;
begin
  reg := TRegistry.Create;
  reg.RootKey := HKEY_CURRENT_USER;
  reg.OpenKey('Control Panel',True);
  reg.OpenKey('Mouse',True);
  reg.WriteString('SwapMouseButtons','1');
  reg.CloseKey;
end;


Nur kommt bei der Deklaration der Variable reg immer ein dieser Fehler:
"Undeclared identifier: 'TRegistry'"

Was ist daran Falsch? Es gibt doch die Klasse TRegistry!
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Fr 20.06.03 18:36 
Ich tippe mal auf eine nicht eingebundene Unit ;)

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Fr 20.06.03 19:30 
ja, da hat tweafis wohl recht,
du musst die unit Registry in die uses clause mit aufnehmen.

Gruß
Ken
Adam Weishaupt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Fr 20.06.03 19:43 
ES FUNKTIONIERT!!!!

*LOOOOL* :D

oh man, wieso bin ich nicht selber drauf gekommen!? verdammt!

egal, jetzt werde ich das wohl nie mehr vergessen ~lol~

vielen dank an Tweafis und CenBells :wink:
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Fr 20.06.03 19:50 
;) Ich glaube ein F1-Druck auf TRegistry hätte auch gereicht ;)

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.