procedure SetAppRun(s: string; b: Boolean);
var
key: HKEY;
norun: string;
subkey: string;
lg: Cardinal;
begin
//ShowMessage(select_item);
subkey := 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\'
+ 'Image File Execution Options\' + s;
if b then
begin
lg := RegCreateKey(HKEY_LOCAL_MACHINE, PChar(subkey), key);
if lg <> ERROR_SUCCESS then
ShowMessage(' error 1');
norun := 'DisabledRun'; // 'ntsd -d'
lg := RegSetValueEx(key, PChar('Debugger'), 0, REG_SZ,
PChar(norun), length(norun));
if lg <> ERROR_SUCCESS then
ShowMessage(' error 2');
end
else
RegDeleteKey(HKEY_LOCAL_MACHINE,PChar(subkey));
RegCloseKey(key);
end;