即切换到其他程序这个窗口能自动夺回活动,要win2k下的代码,98很容易实现:(
解决方案 »
- 纪念逝去的同胞,为震区的人们收集10000句祝福,是中国人的顶起
- [押宝游戏][有大庄友情赞助2w分,压得越多,赚得越多]上证A股从6000点一路跌到现在,最后几个交易日,来一次押宝游戏
- ▲拖放、停靠、相关思路
- 急,关于数据管理的问题!if state in [dsinsert,dsedit] then..............指方向
- 过客,你在那里?我想死你了
- 有关ADO技术的讨论.数据库高手请进!欢迎讨论交流!
- 关于系统权限的一个问题!请有能力者解答![在线等待]
- form的转换问题。
- 怎样转化这段程序?
- to c_hk(小李抢刀)
- 王红波来看!
- 你们常去的源码站点是什么地方? 贴出来大家分享. 散分
代码: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.
任务管理器和开始菜单还是能出来的:(重点就是屏蔽掉他们
这是控制任务管理器的程序:你看看吧
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.
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.
你用这个吧,把任务栏锁住
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;.
.
.
.
.
. //此处太长,略.这段程序怎能锁住任务栏???
.
.
.end.
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;