在WINDOWS2000和XP下, 如何建立注册表, 使得该机器的所有用户都可以使用这些注册项, 
有什么办法, 使得我的程序能够一开机就能运行, 不需用户登陆! 或者每个用户都能得当我的注册表信息! 
我现在用SetRegisterKey()只能用于CURRENT_USER, 我希望在ADMINISTRATOR下初始化这些项目, 使得所有的合法用户登陆后, 这个程序能够得到这些注册项目, 使得程序正常运行机制! 
或者有什么办法, 使得我的程序能够一开机就能运行, 不需用户登陆!

解决方案 »

  1.   

    HKEY_LOCAL_MACHINE
    Registry FunctionsThe following are the registry functions.Function Description 
    RegCloseKey Releases a handle to the specified registry key. 
    RegConnectRegistry Establishes a connection to a predefined registry handle on another computer. 
    RegCreateKeyEx Creates the specified registry key. 
    RegDeleteKey Deletes a subkey. 
    RegDeleteValue Removes a named value from the specified registry key. 
    RegDisablePredefinedCache Disables the predefined registry handle table of HKEY_CURRENT_USER for the specified process. 
    RegEnumKeyEx Enumerates subkeys of the specified open registry key. 
    RegEnumValue Enumerates the values for the specified open registry key. 
    RegFlushKey Writes all the attributes of the specified open registry key into the registry. 
    RegGetKeySecurity Retrieves a copy of the security descriptor protecting the specified open registry key. 
    RegLoadKey Creates a subkey under HKEY_USERS or HKEY_LOCAL_MACHINE and stores registration information from a specified file into that subkey. 
    RegNotifyChangeKeyValue Notifies the caller about changes to the attributes or contents of a specified registry key. 
    RegOpenCurrentUser Retrieves a handle to the HKEY_CURRENT_USER key for the user the current thread is impersonating. 
    RegOpenKeyEx Opens the specified registry key. 
    RegOpenUserClassesRoot Retrieves a handle to the HKEY_CLASSES_ROOT key for the specified user. 
    RegOverridePredefKey Maps a predefined registry key to a specified registry key. 
    RegQueryInfoKey Retrieves information about the specified registry key. 
    RegQueryMultipleValues Retrieves the type and data for a list of value names associated with an open registry key. 
    RegQueryValueEx Retrieves the type and data for a specified value name associated with an open registry key. 
    RegReplaceKey Replaces the file backing a registry key and all its subkeys with another file. 
    RegRestoreKey Reads the registry information in a specified file and copies it over the specified key. 
    RegSaveKey Saves the specified key and all of its subkeys and values to a new file. 
    RegSetKeySecurity Sets the security of an open registry key. 
    RegSetValueEx Sets the data and type of a specified value under a registry key. 
    RegUnLoadKey Unloads the specified registry key and its subkeys from the registry. 
      

  2.   

    这样的:
      调用API的注册表读写函数:RegOpenKeyEx、RegQueryValueEx之类的函数,进行注册表读写