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