Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a key in the registry ?
Message
From
15/11/2002 13:38:33
 
 
To
15/11/2002 10:21:55
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00720364
Message ID:
00723329
Views:
9
>thank for your help. but now i have want to creat key with binary type with these values 00 00 00 00 00 00 00 00 03 00 00 00 00 00 5B E0 00 00 5C E0 00 00 00 00
>
>how can use this as binary type as the procedure num2dword ?

Binary type only took one byte (char) for each value, so this is more simpler than dword type. You can put it in the string variable directly like this
* 00 00 00 00 00 00 00 00 03 00 00 00 00 00 5B E0 00 00 5C E0 00 00 00 00
REG_Binary = 3
c0 = chr(0)
lc_Value = replicate(c0,8) + chr(3) + replicate(c0,5) + chr(0x5B) + ;
   chr(0xE0) + c0 + c0 + chr(0x5C) + chr(0xE0) + replicate(c0,4)
RegSetValueEx(oReg.nCurrentKey, lc_Name, 0, REG_Binary, lc_Value, len(lc_Value))
Or use a procedure
REG_Binary = 3
lc_Value = Str2Byte('00 00 00 00 00 00 00 00 03 00 00 00 00 00 5B E0 00 00 5C E0 00 00 00 00')
RegSetValueEx(oReg.nCurrentKey, lc_Name, 0, REG_Binary, lc_Value, len(lc_Value))

Function Str2Byte(tn_String)	&& as String
Local lc_Hex, lc_Result
   lc_Result = ''
   Do while (len(tn_String) > 0)
      lc_Hex = '0x' + left(tn_String,2)
      lc_Result = lc_Result + chr(val(lc_Hex))
      tn_String = alltrim(substr(tn_String, 3))
   enddo
Return lc_Result
EndFunc
Herman
Previous
Reply
Map
View

Click here to load this message in the networking platform