即切换到其他程序这个窗口能自动夺回活动,要win2k下的代码,98很容易实现:(

解决方案 »

  1.   

    把它永远不能最小化就可以了
    代码:unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure FormCreate(Sender: TObject);
        procedure FormClose(Sender: TObject; var Action: TCloseAction);
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    var temp:integer;
    begin
      systemparametersinfo(spi_screensaverrunning,1,@temp,0);
      //限制功能键
      formstyle:=fsstayontop;
      windowstate:=wsmaximized;
    end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
    var temp:integer;
    begin
     systemparametersinfo(spi_screensaverrunning,0,@temp,0);//取消对功能键的限制
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
    close;
    end;end.
      

  2.   

    to  zdq801104(我很笨,但是我不傻!) :
    任务管理器和开始菜单还是能出来的:(重点就是屏蔽掉他们
      

  3.   

    把任务管理器关掉不能执行
    这是控制任务管理器的程序:你看看吧
    unit mainunit;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls,Registry;type
      TForm1 = class(TForm)
        Label1: TLabel;
        Label2: TLabel;
        Button1: TButton;
        Button2: TButton;
        procedure FormCreate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        procedure CanUseTaskMgr(Value:Boolean);
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.CanUseTaskMgr(Value:Boolean);
    var
     Reg:TRegistry;
    begin
     Reg:=TRegistry.Create;
     try
      Reg.RootKey:=HKEY_CURRENT_USER;
      if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\System', True) then
         begin
          Reg.WriteBool('DisableTaskMgr',Value);
         end;
      finally
       Reg.CloseKey;
       Reg.Free;
      end;
    end;procedure TForm1.FormCreate(Sender: TObject);
    var
     Reg:TRegistry;
    begin
     Reg:=TRegistry.Create;
     try
      Reg.RootKey:=HKEY_CURRENT_USER;
      if Reg.KeyExists('\Software\Microsoft\Windows\CurrentVersion\Policies\System') then
       begin
        Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\System',False);
        if Reg.ValueExists('DisableTaskMgr') then
         begin
          if (Reg.ReadBool('DisableTaskMgr')) then
           begin
            Label2.Caption:='否';
            Button1.Enabled:=False;
            Button2.Enabled:=True;
           end
           else
           begin
            Label2.Caption:='是';
            Button1.Enabled:=True;
            Button2.Enabled:=False;
           end;
         end
         else
         begin
          Label2.Caption:='是';
          Button1.Enabled:=True;
          Button2.Enabled:=False;
         end;
       end
       else
       begin
        Label2.Caption:='是';
        Button1.Enabled:=True;
        Button2.Enabled:=False;
       end;
     finally
      Reg.CloseKey;
      Reg.Free;
     end; 
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
     CanUseTaskMgr(True);
     Label2.Caption:='否';
     Button1.Enabled:=False;
     Button2.Enabled:=True;
     ShowMessage('任务管理器已经被禁止使用!');
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
     CanUseTaskMgr(False);
     Label2.Caption:='是';
     Button1.Enabled:=True;
     Button2.Enabled:=False;
     ShowMessage('任务管理器已经被允许使用!');
    end;end.
      

  4.   

    你用这个吧,把任务栏锁住
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
     h1,h2:Thandle;
    begin
     h1:=findwindow('progmam',nil);
     h2:=findwindow('shell_traywnd',nil);
     enablewindow(h2,true);
    end;procedure TForm1.Button2Click(Sender: TObject);
    var
     h1,h2:Thandle;
    begin
     h1:=findwindow('progmam',nil);
     h2:=findwindow('shell_traywnd',nil);
     enablewindow(h2,false)
    end;end.
      

  5.   

    有意思.但是看不懂上面的代码.
    你用这个吧,把任务栏锁住
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;.
    .
    .
    .
    .
    .      //此处太长,略.这段程序怎能锁住任务栏???
    .
    .
    .end.
      

  6.   

    procedure TForm1.Timer1Timer(Sender: TObject);
    var
      wnd :HWND;
    begin
    //找到应用程序的窗口的句柄
      wnd := FindWindow(nil,'form1');
      if wnd <>0 then
        if isiconic(wnd) then
          ShowWindow(wnd,sw_restore)
        else
          SetForegroundWindow(wnd)
      else
        showmessage('no such window');
    end;
      

  7.   

    ShowWindow(wnd,sw_restore)  这个可能有用吧~~~~~~~~~