home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 February
/
Chip_2002-02_cd1.bin
/
sharewar
/
apaths
/
APSOURCE.ZIP
/
MakeHKey.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-26
|
2KB
|
68 lines
/* MakeHKey - March 26th, 2001
**
** Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
**
** This function creates a System Registry Help entry.
**
** Called: help = a pointer to the HELP data structure to use.
**
** Returns: TRUE upon success, or FALSE if an error exists.
**
** Notes: This routine creates the following key:
**
** HKEY_LOCAL_MACHINE
** Software
** Microsoft
** Windows
** Help
** HELPFILE.HLP = d:\folder
**
*/
#include "AppPaths.h"
extern BOOL far MakeHKey (LPHELP help)
{
auto HKEY key = NULL;
auto LONG err = NIL;
auto DWORD size;
auto DWORD result;
auto char sub[PSTRING];
lstrcpy (sub,REGSTR_PATH_HELP);
err = RegCreateKeyEx (HKEY_LOCAL_MACHINE,
sub,
NIL,
BLANK_STR,
REG_OPTION_NON_VOLATILE,
KEY_SET_VALUE,
NULL,
&key,
&result);
if (err != ERROR_SUCCESS)
return (FALSE);
if (*help->path) {
size = lstrlen (help->path) + 1;
err = RegSetValueEx (key,
help->name,
NIL,
REG_SZ,
(CONST BYTE *) help->path,
size);
}
RegCloseKey (key);
return ((err == ERROR_SUCCESS) ? TRUE : FALSE);
}
/* end of MakeHKey.c - written by Gregory Braun */