如何得到注册表的键值类型呢?

iqyely 2009-05-26 03:45:30
对于注册表的REG_SZ,REG_MULTIHE和REG_DWORD这几种类型,如何得知某个键属于哪一种类型呢?有什么API可以使用么?
...全文
187 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
piaolingfeihu 2009-05-26
  • 打赏
  • 举报
回复
使用 GetDataType函数,请参阅Delphi的帮助:

TRegistry.GetDataType

Returns the enumerated data type of a specified data value associated with the current key.

type TRegDataType= (rdUnknown, rdString, rdExpandString, rdInteger, rdBinary);
function GetDataType(const ValueName: String): TRegDataType;

Description

Call GetDataType to determine the data type of a data value associated with the current key. ValueName is a string containing the name of the data value to query.

GetDataType returns an enumerated value of type TRegDataType. TRegDataType can be one of the following values

Value Meaning

rdUnknown Data value type is of no defined value type.
rdString Data value type is a null-terminated string. It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.
rdExpandString Data value type is a null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdInteger Data value type is a32-bit number.
rdBinary Data value type is binary data, in any form.
willflyz 2009-05-26
  • 打赏
  • 举报
回复
RegQueryValue
Delphi TRegistry.GetDataType已经封装好了
gyk120 2009-05-26
  • 打赏
  • 举报
回复
GetDataType这个API应该可以

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧