#define HKEY_CURRENT_USER 2147483649
#define KEY_ALL_ACCESS 983103
#define REG_SZ 1
STATIC FUNCTION PDFGETOPTION( cKey )
LOCAL hKey := 0
LOCAL nType := REG_SZ
LOCAL cData := SPACE( 256 )
LOCAL nSize := LEN( cData )
REGOPENKEY( HKEY_CURRENT_USER, "Software\PDFCreator\Program", 0, KEY_ALL_ACCESS, @hKey )
REGQUERYVALUE( hKey, cKey, 0, @nType, @cData, @nSize )
REGCLOSEKEY( hKey )
RETURN LEFT( cData, AT( CHR( 0 ), cData ) - 1 )
STATIC FUNCTION PDFSETOPTION( cKey, cValue )
LOCAL hKey := 0
LOCAL nType := REG_SZ
LOCAL nSize := LEN( cValue )
REGOPENKEY( HKEY_CURRENT_USER, "Software\PDFCreator\Program", 0, KEY_ALL_ACCESS, @hKey )
REGSETVALUE( hKey, cKey, 0, nType, cValue, nSize )
REGCLOSEKEY( hKey )
RETURN NIL
DLL32 STATIC FUNCTION REGOPENKEY( hKey AS LONG, cSubKey AS LPSTR, nOptions AS DWORD, nSamDesired AS DWORD, @nHandle AS PTR ) AS LONG;
PASCAL FROM "RegOpenKeyExA" LIB "advapi32.dll"
DLL32 STATIC FUNCTION REGQUERYVALUE( hKey AS LONG, cValueName AS LPSTR, nReserved AS LONG, @nType AS PTR, @cData AS LPSTR, @nSize AS PTR ) AS LONG;
PASCAL FROM "RegQueryValueExA" LIB "advapi32.dll"
DLL32 STATIC FUNCTION REGSETVALUE( hKey AS LONG, cValueName AS LPSTR, nReserved AS LONG, nType AS DWORD, cData AS LPSTR, nData AS DWORD ) AS LONG;
PASCAL FROM "RegSetValueExA" LIB "advapi32.dll"
DLL32 STATIC FUNCTION REGCLOSEKEY( hKey AS LONG ) AS LONG;
PASCAL FROM "RegCloseKey" LIB "advapi32.dll"
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 50 guests