Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 29.07.05 20:30 
Hi, Delpher,

ich verwende auf form1 einen timer, der bei Maus- oder Tastatur-Untätigkeit eine passworteingabe erzwingt. maus oder tastatur werden mit HOOK-functions überwacht.

So weit, so gut. Aber wenn ich auf form2 bin und die Zeit der Untätigkeit verstreichen lasse, darf ich mich auf form2 neu einloggen und wenn ich dann auf form1 wechsele, dort noch einmal.

Wie kann ich das zweimalige Neueinloggen verhindern??

Danke für Hilfe,
D. Annies
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 30.07.05 09:52 
Hi, Delpher,

8 hits lassen mich ja auf eine Antwort hoffen, aber vielleicht fehlt Code.
Also:

ausblenden volle Höhe Delphi-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:
function KeyboardProc(nCode:integer; wParam:longint; lParam:longint):longint; stdcall;
begin
  result := CallNextHookEx(KeyboardHook, ncode, wparam, lparam);
  form1.timer1.enabled := false;  form1.timer1.enabled := true;
end;

function MouseProc(nCode:integer; wparam: longint; var MouseHookStruct: TMouseHookStruct):longint; stdcall;
begin
  result := CallNextHookEx(MouseHook, nCode, wparam, longint(@MouseHookStruct));
  form1.timer1.enabled := false;  form1.timer1.enabled := true;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  bild := TJPEGImage.create; bild.loadfromfile('DSCF0134.jpg');
  image3.Picture.Graphic := bild; image3.setbounds(250,250,500,420);
  Image3.Visible := true;
  form2.GroupBox2.Visible := false; form2.GroupBox4.Visible := false;
  form2.TntMemo1.Visible := false;
  form2.Image2.Picture.Graphic := bild; form2.Image2.SetBounds(250,250,500,420);
  form2.Image2.Visible := true;
  showmessage('Neuanmeldung wegen Zeitüberschreitung!');
  if form1.visible then
  begin
    image3.Visible := false; listbox1.Visible := true; button22.Visible := true;
    form1.edit14.text := ''; form1.image1dblclick(self);
  end;
  if form2.visible then
  begin
      form2.Image2.Visible := false; form2.edit1.text := ''; form2.button6click(self);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);        // Initialisierungen
begin
  windowstate := wsmaximized; home := getcurrentdir;
  BorderIcons := BorderIcons - [biSystemMenu];
  timer1.Enabled := false;
  KeyboardHook := SetWindowsHookEx(WH_KEYBOARD, @KeyboardProc, 0, GetCurrentThreadID);
  MouseHook    := SetWindowsHookEx(WH_MOUSE, @MouseProc, 0, GetCurrentThreadID);
  timer1.interval := 10*60000;     //15*60000;  // nach 15 Minuten
  timer1.enabled := true;

  // usw…

end;



Hatte erst gedacht, dass es eine prinzipielle Antwort geben könnte, mal sehen.

Gruß aus Lübeck, D. Annies
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 03.08.05 11:31 
Kurze Nachfrage:

Hat denn noch keiner ein ähnliches Problem gehabt?
(Kann ich mir nicht vorstellen ...) :shock:

D. Annies