Hi Guys:
Here I have to use "VFP 5.0" to code in.
A)What am I atepeting to do:
Change the value from 2 to 3.
Target: Registry Path = HKEY_LOCAL_MACHINE\SOFTWARE\PitneyBowes\Ascent\CustomerUpgradable
Registry Key: Value Name = CustomerUpgradable
LOGIC:
If the Value Data = 2 Then
Value Data = '3' Else
Quit
EndElse
Or I can overwrite the value (as shown below) which might be better in case the value was other than 2:
The following sniplet I'm generating an error during compile time - "Too Few Arguments"
Thanks Guys!
~PM
SNIPLET:
lnResult = RegSetValueEx( ;
m.lhKey, ;
"CustomerUpgradable", ;
REG_OPTION_RESERVED, ;
REG_SZ, ;
"3")
FULL CODE BELOW:
*// PURPOSE:
*// Creates a value called
*// CustomerUpgradable under the HHKEY_LOCAL_MACHINE*// SOFTWARE\PitneyBowes\Ascent\CustomerUpgradable, and sets
*// the value to "3"
#include registry.h
* Declare the API functions:
declare integer RegCreateKeyEx in Win32API ;
integer nhKey, ;
string @cSubKey, ;
integer nReserved, ;
string cKeyClass, ;
integer nOptions, ;
integer nSecurityAccessMask, ;
integer nSecurityAttributes, ;
integer @nKeyHandle, ;
integer @nDisposition
declare integer RegSetValueEx in Win32API ;
integer nKeyHandle, ;
string cValueName, ;
integer nReserved, ;
integer nType, ;
string cBuffer, ;
integer nBufferSize
declare integer RegCloseKey in Win32API ;
integer nKeyHandle
* Open the key:
local lhKey, lnDisposition, lnResult
store 0 to lhKey, lnDisposition
lnResult = RegCreateKeyEx( ;
HKEY_LOCAL_MACHINE, ;
'SOFTWARE\PitneyBowes\Ascent\CustomerUpgradable', ;
REG_OPTION_RESERVED, ;
REG_CLASS_DEFAULT, ;
REG_OPTION_NON_VOLATILE, ;
KEY_ALL_ACCESS, ;
REG_SECURITY_DEFAULT, ;
@lhKey, ;
@lnDisposition )
* Writes the new value:
lnResult = RegSetValueEx( ;
m.lhKey, ;
"CustomerUpgradable", ;
REG_OPTION_RESERVED, ;
REG_SZ, ;
"3")
=RegCloseKey( m.lhKey )
Here I have to use "VFP 5.0" to code in.
A)What am I atepeting to do:
Change the value from 2 to 3.
Target: Registry Path = HKEY_LOCAL_MACHINE\SOFTWARE\PitneyBowes\Ascent\CustomerUpgradable
Registry Key: Value Name = CustomerUpgradable
LOGIC:
If the Value Data = 2 Then
Value Data = '3' Else
Quit
EndElse
Or I can overwrite the value (as shown below) which might be better in case the value was other than 2:
The following sniplet I'm generating an error during compile time - "Too Few Arguments"
Thanks Guys!
~PM
SNIPLET:
lnResult = RegSetValueEx( ;
m.lhKey, ;
"CustomerUpgradable", ;
REG_OPTION_RESERVED, ;
REG_SZ, ;
"3")
FULL CODE BELOW:
*// PURPOSE:
*// Creates a value called
*// CustomerUpgradable under the HHKEY_LOCAL_MACHINE*// SOFTWARE\PitneyBowes\Ascent\CustomerUpgradable, and sets
*// the value to "3"
#include registry.h
* Declare the API functions:
declare integer RegCreateKeyEx in Win32API ;
integer nhKey, ;
string @cSubKey, ;
integer nReserved, ;
string cKeyClass, ;
integer nOptions, ;
integer nSecurityAccessMask, ;
integer nSecurityAttributes, ;
integer @nKeyHandle, ;
integer @nDisposition
declare integer RegSetValueEx in Win32API ;
integer nKeyHandle, ;
string cValueName, ;
integer nReserved, ;
integer nType, ;
string cBuffer, ;
integer nBufferSize
declare integer RegCloseKey in Win32API ;
integer nKeyHandle
* Open the key:
local lhKey, lnDisposition, lnResult
store 0 to lhKey, lnDisposition
lnResult = RegCreateKeyEx( ;
HKEY_LOCAL_MACHINE, ;
'SOFTWARE\PitneyBowes\Ascent\CustomerUpgradable', ;
REG_OPTION_RESERVED, ;
REG_CLASS_DEFAULT, ;
REG_OPTION_NON_VOLATILE, ;
KEY_ALL_ACCESS, ;
REG_SECURITY_DEFAULT, ;
@lhKey, ;
@lnDisposition )
* Writes the new value:
lnResult = RegSetValueEx( ;
m.lhKey, ;
"CustomerUpgradable", ;
REG_OPTION_RESERVED, ;
REG_SZ, ;
"3")
=RegCloseKey( m.lhKey )