L
laodaoyaoguai
Unregistered / Unconfirmed
GUEST, unregistred user!
我有一程序,如下
procedure TForm1.FormCreate(Sender: TObject);
var
Reg:TRegistry;
hDesktop : THandle;
wndHandle : THandle;
wndClass : array[0..50] of Char;
begin
Reg:=Tregistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
if Reg.OpenKey('/software/Microsoft/Windows/CurrentVersion/RunOnce',True) then
Reg.WriteString('starup','h:/program/Project1');
hDesktop :=FindWindow('Progman', nil);
ShowWindow(hDesktop, SW_HIDE);
StrPCopy(@wndClass[0], 'Shell_TrayWnd');
wndHandle :=FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_HIDE);
table1.Active:=true;
count:=0;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
results:variant;
low:integer;
hDesktop : THandle;
wndHandle : THandle;
wndClass : array[0..50] of Char;
begin
count:=count+1;
with Query1 do
begin
close;
SQL.Clear;
SQL.Add('select*from dbo.person');
SQL.Add('where id=:low');
ParamByName('low').AsInteger:=strtoint(edit1.text);
open;
end;
IF Query1.FieldValues['password']=edit2.Text then
begin
showmessage('身份已确定,欢迎进入!');
********************************************************************************
hDesktop :=FindWindow('Progman', nil);
ShowWindow(hDesktop, SW_show);
StrPCopy(@wndClass[0], 'Shell_TrayWnd');
wndHandle :=FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_RESTORE);
end
else
begin
showmessage('用户密码错误!');
IF (count=3) then close;
end;
end;
end.
此程序在WIN2000下,在编辑环境下正确运行(此程序是屏蔽桌面图标及状态栏,并且加入启动中)
但是在系统重起后,此程序只运行星杠上面的部分,请各位高手指导!
procedure TForm1.FormCreate(Sender: TObject);
var
Reg:TRegistry;
hDesktop : THandle;
wndHandle : THandle;
wndClass : array[0..50] of Char;
begin
Reg:=Tregistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
if Reg.OpenKey('/software/Microsoft/Windows/CurrentVersion/RunOnce',True) then
Reg.WriteString('starup','h:/program/Project1');
hDesktop :=FindWindow('Progman', nil);
ShowWindow(hDesktop, SW_HIDE);
StrPCopy(@wndClass[0], 'Shell_TrayWnd');
wndHandle :=FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_HIDE);
table1.Active:=true;
count:=0;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
results:variant;
low:integer;
hDesktop : THandle;
wndHandle : THandle;
wndClass : array[0..50] of Char;
begin
count:=count+1;
with Query1 do
begin
close;
SQL.Clear;
SQL.Add('select*from dbo.person');
SQL.Add('where id=:low');
ParamByName('low').AsInteger:=strtoint(edit1.text);
open;
end;
IF Query1.FieldValues['password']=edit2.Text then
begin
showmessage('身份已确定,欢迎进入!');
********************************************************************************
hDesktop :=FindWindow('Progman', nil);
ShowWindow(hDesktop, SW_show);
StrPCopy(@wndClass[0], 'Shell_TrayWnd');
wndHandle :=FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_RESTORE);
end
else
begin
showmessage('用户密码错误!');
IF (count=3) then close;
end;
end;
end.
此程序在WIN2000下,在编辑环境下正确运行(此程序是屏蔽桌面图标及状态栏,并且加入启动中)
但是在系统重起后,此程序只运行星杠上面的部分,请各位高手指导!