LONG RegQueryValue( HKEY hKey, // handle to key to query LPCTSTR lpSubKey, // subkey name LPTSTR lpValue, // string buffer PLONG lpcbValue // size of returned string ); 具体解释看MSDN吧
LONG RegQueryValue( HKEY hKey, // handle to key to query LPCTSTR lpSubKey, // subkey name LPTSTR lpValue, // string buffer PLONG lpcbValue // size of returned string );
若错误为:ERROR_ALREADY_EXISTS),则表示已经有该实例在运行
你的程序一运行就可以调用这个函数检查特定键值是否存在.
如果不存在
调用RegCreateKey创建一个
我明白了,谢谢!
能不能再告诉我 RegQueryValue
这个函数怎么用?:)
HKEY hKey, // handle to key to query
LPCTSTR lpSubKey, // subkey name
LPTSTR lpValue, // string buffer
PLONG lpcbValue // size of returned string
);
具体解释看MSDN吧
HKEY hKey, // handle to key to query
LPCTSTR lpSubKey, // subkey name
LPTSTR lpValue, // string buffer
PLONG lpcbValue // size of returned string
);