Dide
asked on
Disable shutdown and LogOff but Start Button Enable
I Wrote this code
EnableWindow(FindWindowEx( FindWindow ('Shell_Tr ayWnd'_nil ),0,'Butto n',nil),FA LSE);
this code to disable button start Win9x, How if I want just disable shutdown and log off function ? but
start button and others are enable ?
EnableWindow(FindWindowEx(
this code to disable button start Win9x, How if I want just disable shutdown and log off function ? but
start button and others are enable ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried your comments but my windows can logoff and shuting down
you may need to restart windows before the reg tweaks will work.
HI,
Tyfing, in your code there are two errors:
1.reg:=TRegistry.Create, not reg.Create;
2.OpenKey has two parameters not one.
Maybe that is why Dide failed in using your proposal.
Sincerely,
Nestorua.
Tyfing, in your code there are two errors:
1.reg:=TRegistry.Create, not reg.Create;
2.OpenKey has two parameters not one.
Maybe that is why Dide failed in using your proposal.
Sincerely,
Nestorua.
ASKER
Yes these errors, but I wrote :
Var
reg:Tregistry;
const
a='NoClose';
begin
reg:=TRegistry.create;
reg.rootkey:=HKEY_Current_ User;
reg.openkey('software\micr osoft\wind ows\curren tversion\p olicies\ex plorer',Fa lse);
reg.writestring(a, '1');
end;
end.
but it's wrong still
I try this write yhis code on event create form
procedure TFormX.Create.....;
Const
MyWM_NotifyIcon=WM_USER+
Var
IC:NOTIFYICONDATA;
HOwner:HWND;
Begin
HOwner:GetWindow(FormX.Han dle,GW_OWN ER;
ic.cbsize:=size of(NOTIFYICONDATA);
ic.Wnd:=FormX.Handle;
ic.UID:=13598056;
ic.UCallBackMessage:=MyWM_ Notifyicon ;
ic.hicon:=Application.icon .Handle;
ic.UFlags:=NIF_ICON or NIFMESSAGE or NIF_TIP;
end;
these code solve my problem but I don't Understand with these code, anyone can explain to me ?
Var
reg:Tregistry;
const
a='NoClose';
begin
reg:=TRegistry.create;
reg.rootkey:=HKEY_Current_
reg.openkey('software\micr
reg.writestring(a, '1');
end;
end.
but it's wrong still
I try this write yhis code on event create form
procedure TFormX.Create.....;
Const
MyWM_NotifyIcon=WM_USER+
Var
IC:NOTIFYICONDATA;
HOwner:HWND;
Begin
HOwner:GetWindow(FormX.Han
ic.cbsize:=size of(NOTIFYICONDATA);
ic.Wnd:=FormX.Handle;
ic.UID:=13598056;
ic.UCallBackMessage:=MyWM_
ic.hicon:=Application.icon
ic.UFlags:=NIF_ICON or NIFMESSAGE or NIF_TIP;
end;
these code solve my problem but I don't Understand with these code, anyone can explain to me ?
ASKER
ups...sorry
....
I try write this code on event create form
.....
MyWM_NotifyIcon=WM_USER + 1234;
.......
....
I try write this code on event create form
.....
MyWM_NotifyIcon=WM_USER + 1234;
.......
ASKER
When a user shutdown windows, The onCloseQuery event is activated, and a program can use it to stop the shutdown process
so we can stop shutdown process with the set onCloseQuery event :
CanClose:=False;
so we can stop shutdown process with the set onCloseQuery event :
CanClose:=False;
ASKER
I Have the answer
When a user shutdown windows, The onCloseQuery event is activated, and a program can use it to stop the shutdown process
so we can stop shutdown process with the set onCloseQuery event :
CanClose:=False;
When a user shutdown windows, The onCloseQuery event is activated, and a program can use it to stop the shutdown process
so we can stop shutdown process with the set onCloseQuery event :
CanClose:=False;
Var
reg:tregistry;
begin
reg.create;
reg.rootkey:=HKEY_Current_ User;
reg.createkey('software\mi crosoft\cu rrentversi on\policie s\explorer ');
reg.openkey('software\micr osoft\wind ows\curren tversion\p olicies\ex plorer', TRUE);
reg.writestring('NoClose', '1'); // This disables Shutdown, you can change it to NoLogoff to disable Log-off.
REG.CLOSEKEY;
end;
end.
reg:tregistry;
begin
reg.create;
reg.rootkey:=HKEY_Current_
reg.createkey('software\mi
reg.openkey('software\micr
reg.writestring('NoClose',
REG.CLOSEKEY;
end;
end.
Dide:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
accept inthe's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thanks,
geobul
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
accept inthe's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thanks,
geobul
EE Cleanup Volunteer
HKCU\software\microsoft\wi
add in
NoClose and put its value to 1 to disable Shutdown
NoLogoff and put its value to 1 to disable Log-off
source is below
Var
reg:tregistry;
begin
reg.create;
reg.rootkey:=HKEY_Current_
reg.openkey('software\micr
reg.writestring('NoClose',
end;
end.