Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading REG_BINARY value with native language characters
#1
I failed to read with correct native language characters a binary  value in a REG_BINARY registry entry. Any advice is mostly welcome. Here is the code :

Function tempf08
Code:
Copy      Help
str sval snam s svalm
str skey
skey.from("Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSavePidlMRU\" "*")
snam="MRUlistEx"
int i
i=rget(svalm snam skey 0 "" REG_BINARY)
out i
int ib=0
byte b
b=svalm[ib]
s=b
out s
i=rget(sval s skey 0 "" REG_BINARY)
out i
sval.ansi
out sval
#2
It is not string. Looks like ITEMIDLIST.
#3
Macro Macro2972
Code:
Copy      Help
word* w
int hr=SHGetNameFromIDList(+sval SIGDN_FILESYSPATH &w)
if(hr) end ES_FAILED 0 hr
;outb w 10 1
s.ansi(w)
CoTaskMemFree w
out s
#4
Thank you! However, I am still in need of advice regarding "SHGetNameFromIDList" . Where can I find it? Does it have to be - somehow - incorporated in QM?
#5
It is a Windows API function, added in Windows Vista. For XP need more code, call several API functions: SHBindToParent, GetDisplayNameOf, StrRetToStrW, CoTaskMemFree.
#6
Thank you. But I am running Win-10, I cannot understand why SHGetNameFromIDList is not recognised as API and it gives error. However, it worked - hopefully correct - when I used "WINAPIV.SHGetNameFromIDList". Best regards.


Forum Jump:


Users browsing this thread: 1 Guest(s)