Einzelnen Beitrag anzeigen

Nils_13

Registriert seit: 15. Nov 2004
2.647 Beiträge
 
#4

Re: Startmenu Disablen und fenster unschließbar

  Alt 30. Jan 2006, 16:05
Es schließt sich zwar nicht direkt, aber du musst es schon 999999999999999999 beenden, um das Programm endgültig zu beenden.
Delphi-Quellcode:
program Passwort;

uses
  Windows,
  Messages,
  SysUtils,
  Variants,
  Classes,
  Graphics,
  Controls,
  Dialogs,
  Forms,

  pas in 'pas.pas{Form1};

{$R *.res}

const
  cmdShow: array[Boolean] of Integer = (SW_HIDE, SW_SHOW);

var
  i: Integer; // Fuer die Schleife
  bShow: Boolean;
  CanClose: Boolean;
  Key: Word;

begin
  Application.Initialize;
  if key = VK_LWIN then
    exit;
  if bShow = True then ShowWindow(FindWindow ('Shell_TrayWnd',nil), SW_SHOWNA)
  else ShowWindow(FindWindow ('Shell_TrayWnd',nil), SW_HIDE);
  if bShow = True then EnableWindow(FindWindow ('Shell_TrayWnd',nil), TRUE)
  else EnableWindow(FindWindow ('Shell_TrayWnd',nil), FALSE);
  CanClose := False;
  // Passwortabfrage
  for i := 0 to 999999999 do
  begin
    if InputBox('Passwortabfrage', 'Bitte Passwort angeben', '') = 'obelix13then
    begin
      Application.Terminate;
        if bShow = True then ShowWindow(FindWindow ('Shell_TrayWnd',nil), SW_HIDE)
        else ShowWindow(FindWindow ('Shell_TrayWnd',nil), SW_SHOWNA);
        if bShow = True then EnableWindow(FindWindow ('Shell_TrayWnd',nil), FALSE)
        else EnableWindow(FindWindow ('Shell_TrayWnd',nil), TRUE);
      break;
    end;
    if i = 999999999999999999 then
      halt;
  end;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
  Mit Zitat antworten Zitat