鼠标双击.reg,然后就合并了。

解决方案 »

  1.   

    HINSTANCE ShellExecute(
    HWND hwnd,LPCTSTR lpOperation,LPCTSTR lpFile,LPCTSTR lpParameters,LPCTSTR lpDirectory,INT nShowCmd );
    用这个函数,直接调用reg文件,系统应该会自动的安装。
    ShellExecute(0,nil,'a.reg',nil,nil,SW_HIDE)
     
      

  2.   

    ShellExecute(0,nil,'a.reg',nil,nil,SW_HIDE)不行!ShellExecute(0,nil,'a.reg',nil,nil,SW_SHOW)还可以,但有提示对话框,怎么去掉该对话框?或着其他方法?第2个问题呢?
      

  3.   

    Tregistry不麻烦吧,看看它的LoadKey方法吧,照样可以从文件中读取的。
      

  4.   

    TRegistery的LoadKey这个方法更好!
    function LoadKey(const Key, FileName: String): Boolean;
    Description
    Call LoadKey to:
    1 Create a new subkey under the root key, and
    2 Load registry information from a file into the subkey. Registry information can include data values, subkeys, and data values for those subkeys.
    LoadKey is intended to simplify creation of a key, its values and subkeys, and the values for those subkeys in a single operation. A key, its subkeys, and all data values of the key and its subkeys is called a hive. Rather than creating each key and value separately, an application can read a hive from a file. This is especially useful for applications that users can reconfigure at run time.
    Note: Before an application calls LoadKey, the RootKey property must be set to HKEY_USERS, HKEY_LOCAL_MACHINE, or to a key returned by a previous call to RegistryConnect.
      

  5.   

    那请问第一个参数hKey怎么给?reg文件包含了所有的信息了啊!?
      

  6.   

     winexec('regedit /s a.reg',sw_normal);
    没有对话框的