Disabling Default MessageBox Reply

  • Thread starter David Jones vpac org>
  • Start date
D

David Jones vpac org>

Is it possible to temporarly disable this?
Some apps default are in the negative which stops you from actioning them.
This is typically needed when the system needs reconfiguring.

If there isn't an app that can reconfigure it what about removing its
registry entries,
and rebooting.. Then restore the registry later.

--
David Jones
Software Developer
(Embeddded Systems)
Victorian Partnership of Advanced Computing
Melbourne, Victoria Australia
 
M

Mike Warren

David said:
Is it possible to temporarly disable this?
Some apps default are in the negative which stops you from actioning
them. This is typically needed when the system needs reconfiguring.

If there isn't an app that can reconfigure it what about removing its
registry entries,
and rebooting.. Then restore the registry later.

Here is how I do it in Delphi. Note: it is not necessary to reboot the
computer but it is necessary to start your program after the changes
have been made. These settings appear to be applied to each program at
program start.

procedure SetMessageBoxDefResponse(DoSet: Boolean);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
try
Reg.LazyWrite := False;
Reg.RootKey := HKEY_LOCAL_MACHINE;
if DoSet then
begin
Reg.OpenKey('SYSTEM\ControlSet001\Control\Error Message
Instrument', True);
Reg.WriteBool('EnableDefaultReply', True);
Reg.WriteBool('EnableLogging', True);
Reg.WriteInteger('LogSeverity', 0);
Reg.CloseKey;

Reg.OpenKey('SYSTEM\ControlSet001\Services\EventLog\Application\Error
Instrument', True);
Reg.WriteString('EventMessageFile',
'%SystemRoot%\System32\User32.dll');
Reg.WriteInteger('TypesSupported', 7);
Reg.CloseKey;
end else begin
Reg.DeleteKey('SYSTEM\ControlSet001\Control\Error Message
Instrument');

Reg.DeleteKey('SYSTEM\ControlSet001\Services\EventLog\Application\Error
Instrument');
end;
except
on E:Exception do AddToSysLog('[ERROR] ' + E.Message);
end;
finally
Reg.Free;
end;
end;
 
D

David Jones vpac org>

Thanks Mike, I give that a try.
--
David Jones
Software Developer
(Embeddded Systems)
Victorian Partnership of Advanced Computing
Melbourne, Victoria Australia


Mike Warren said:
David said:
Is it possible to temporarly disable this?
Some apps default are in the negative which stops you from actioning
them. This is typically needed when the system needs reconfiguring.

If there isn't an app that can reconfigure it what about removing its
registry entries,
and rebooting.. Then restore the registry later.

Here is how I do it in Delphi. Note: it is not necessary to reboot the
computer but it is necessary to start your program after the changes
have been made. These settings appear to be applied to each program at
program start.

procedure SetMessageBoxDefResponse(DoSet: Boolean);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
try
Reg.LazyWrite := False;
Reg.RootKey := HKEY_LOCAL_MACHINE;
if DoSet then
begin
Reg.OpenKey('SYSTEM\ControlSet001\Control\Error Message
Instrument', True);
Reg.WriteBool('EnableDefaultReply', True);
Reg.WriteBool('EnableLogging', True);
Reg.WriteInteger('LogSeverity', 0);
Reg.CloseKey;

Reg.OpenKey('SYSTEM\ControlSet001\Services\EventLog\Application\Error
Instrument', True);
Reg.WriteString('EventMessageFile',
'%SystemRoot%\System32\User32.dll');
Reg.WriteInteger('TypesSupported', 7);
Reg.CloseKey;
end else begin
Reg.DeleteKey('SYSTEM\ControlSet001\Control\Error Message
Instrument');

Reg.DeleteKey('SYSTEM\ControlSet001\Services\EventLog\Application\Error
Instrument');
end;
except
on E:Exception do AddToSysLog('[ERROR] ' + E.Message);
end;
finally
Reg.Free;
end;
end;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top