Home > database >  RegistryGet registry reg_binary data, how to convert a string
RegistryGet registry reg_binary data, how to convert a string

Time:09-21

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ ComDlg32 \ OpenSaveMRU \ * \ MRUList
Here the value of the record of the history file open saved
Under xp system, the data type is reg_sz, by RegistryGet function can be directly removed,
The code examples are as follows:
String ls_express, ls_dir
Long ll_rtn
Blob lbl_temp

Ls_express='HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ ComDlg32 \ OpenSaveMRU \ *'
Ll_rtn=RegistryGet (ls_express, "MRUList", Regstring! , ls_dir)


But in vista/Windows 7, the registry location and data types are changed
HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ ComDlg32 \ OpenSavePidlMRU \ * \ MRUListEx
Data type is reg_binary, through RegistryGet function after out, should do a conversion to use,
My way is:
String ls_express
Long ll_rtn
Blob lbl_temp

Ls_express='HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ ComDlg32 \ OpenSavePidlMRU \ *'
Ll_rtn=RegistryGet (ls_express, "MRUListEx", RegBinary! , lbl_temp)

Now I am stuck in here, lbl_temp right into a string,

Consult everybody, here,


CodePudding user response:

Test yourself, write their own regbinary! Remove, whether normal and convert
 blob lb 
HKEY_LOCAL_MACHINE \ SOFTWARE \ registrySet (" aa ", "aa", RegBinary! , blob (' test '))
HKEY_LOCAL_MACHINE \ SOFTWARE \ registryGet (" aa ", "aa", RegBinary! , lb)
Messagebox (' ', a string (lb))

CodePudding user response:

String ls_express
Long ll_rtn
Blob lbl_temp

Ls_express='HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ ComDlg32 \ OpenSavePidlMRU \ *'
Ll_rtn=RegistryGet (ls_express, "MRUListEx", RegBinary! , lbl_temp)

Messagebox (' ', a string (lbl_temp EncodingANSI!) )

Messagebox (' ', a string (lbl_temp EncodingUTF8!) )



The following is the help of the string in the pb, please refer to the

The Description

Converts the data in a blob to a string value. If the blob 's value is not text data, string attempts to interpret the data as the characters.

Syntax

String (blob, encoding} {)

Argument Description
Blob The blob whose value you want returned as a string. The blob can also be an Any variable containing a blob.
Encoding Character encoding of the blob you want converted. The Values are:? EncodingANSI! ? EncodingUTF8! ? EncodingUTF16LE! (the default)? EncodingUTF16BE!

CodePudding user response:

Useless..
I have try it before.
It return a messy code.

CodePudding user response:

Please refer to:
http://social.msdn.microsoft.com/Forums/bs-Cyrl-BA/vcmfcatl/thread/bfd89fd3-8dc7-4661-9878-1d8a1bf62697
How to get PIDL from OpenSavePidlMRU
  • Related