舒淇的献身:vb问题:为什么用 RegCreateKey 写入注册表的数据是乱码?

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 09:35:25
如下,其中showTime.exe是我自己写的一个程序
写入注册表后,数据类型是“?”,这是为什么呢,
要怎么写才能实现此程序的开机自动运行呢?

RegCreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", hKey
prog = "C:\Documents and Settings\Administrator\桌面\showTime.exe"
RegSetValueEx hKey, "showTime", 0&, REG_SZ, prog, 2 * Len(prog)