首先新建一个工程,在新建的窗体上添加以下控件并设置相应属性:
控件名属性值
Label1Caption注册表键值:
Label2Caption注册姓名:
Label3Caption空
Label4Caption注册公司:
Label5Caption空
Label6Caption空
Text1Text空
Text2Text空
Command1Caption写入注册表
Command2Caption退出
然后,在程序的声明部分添加如下代码:
PrivateDeclareFunctionRegCreateKeyLib"advapi32.dll"Alias"RegCreateKeyA"(ByValhKeyAsLong,ByVallpSubKeyAsString,phkResultAsLong)AsLong
PrivateDeclareFunctionRegQueryValueExLib"advapi32.dll"Alias"RegQueryValueExA"(ByValhKeyAsLong,ByVallpValueNameAsString,ByVallp...[ 查看全文 ]