home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 February
/
Chip_2002-02_cd1.bin
/
sharewar
/
apaths
/
APSOURCE.ZIP
/
KillRKey.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-26
|
972b
|
41 lines
/* KillRKey - March 26th, 2001
**
** Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
**
** This function removes the specified Run values.
**
** Called: run = a pointer to the RUN data structure to use.
**
** Returns: TRUE upon success, or FALSE if an error exists.
*/
#include "AppPaths.h"
extern BOOL far KillRKey (LPRUN run,BOOL user)
{
auto HKEY key = NULL;
auto LONG err;
auto char sub[PSTRING];
lstrcpy (sub,REGSTR_PATH_RUN);
err = RegOpenKeyEx ((user) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
sub,
NIL,
KEY_WRITE,
&key);
if (err != ERROR_SUCCESS)
return (FALSE);
err = RegDeleteValue (key,run->name);
RegCloseKey (key);
return ((err == ERROR_SUCCESS) ? TRUE : FALSE);
}
/* end of KillRKey.c - written by Gregory Braun */