Autor Beitrag
Date Murphy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Sa 20.07.02 13:32 
Hi,

Gibt es eine Möglichkeit den Computer unter Windows 2000 über einen

Button zu sperren, als über STRG + ALT + ENTF --> Computer sperren :?:

Danke schon mal für eure Tipps :D

Gruß Date Murphy
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Sa 20.07.02 14:03 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
function BlockInput (fBlockInput : boolean) : DWord; stdcall; external 'user32.DLL';

procedure TForm1.Button1Click(Sender: TObject);
begin
  BlockInput(true);
  SystemParametersInfo(97,Word(True),nil,0); 
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  SystemParametersInfo(97,Word(False),nil,0);
end;


So kannste Usereingaben blocken, d.h. die Maus kann nicht mehr bewegt werden etc.. Wie man sieht, habe ich einen Timer verwendet, um das Blocken rückgängig zu machen. Das ist allerdings eine nicht sehr empfehlenswerte Methode.

Ich denke mal, dass du eher so eine Artpasswortabfrage haben willst. Dazu müssteste aber Strg-Alt-Entf unterdrücken und das ist soweit ich weiss unter Windows 2000 nicht möglich außer durch Modifizierung der User32.dll.

_________________
Viele Grüße
Jakob
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Sa 20.07.02 14:05 
Habe das Programm eben nochmal getestet. Selbst durch das Blocken, lässt sich Strg-Alt-Entf nicht unterdrücken :roll:

_________________
Viele Grüße
Jakob
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 20.07.02 14:56 
Hi,

Zitat:
The LockWorkStation function locks the workstation's display,
protecting it from unauthorized use.
This function has the same result as pressing Ctrl+Alt+Del and
clicking Lock Workstation.
To unlock the workstation, the user must log in.

Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Unsupported.


tom
Date Murphy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Sa 20.07.02 15:54 
@ tom

Das wusste ich schon :)

Ich suche eine Möglichkeit, genau dieses aus meinem Programm heraus aufzurufen.

Gruß Date Murphy :D
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 20.07.02 16:01 
Dann rufe doch LockWorkStation auf!
Date Murphy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Sa 20.07.02 16:21 
Wie kann ich "LockWorkStation" aufrufen ?
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 20.07.02 16:32 
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  LockWorkStation
end;
Date Murphy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Sa 20.07.02 16:41 
Danke schon mal, werde es mal testen :)
Date Murphy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Sa 20.07.02 17:16 
@ tom

BIG THX, das ist genau der Befehl, den ich gesucht habe.

So long Date Murphy :D