在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
下添加一项字符串类型的键,然后将键值设为你的程序的路径

解决方案 »

  1.   

    还有一个办法,在每次程序退出时(比如Form_QueryUnload事件中),搞几行代码写注册表,写到:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce中,
    随便取个名字作键名,键值是程序路径。
      

  2.   

    直接加到开始中的启动中或在WIN.INI中的RUN=加入你的程序名
      

  3.   

    用程序实现的话,还是修改注册表,在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    下添加一项字符串类型的键,然后将键值设为你的程序的路径 
    用regsetvalueex函数
    dim hKey as long
    dim subkey as long
    subkey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
    hKey = regOpenKey(HKEY_LOCAL_MACHINE,subkey) ret =regsetvalueex(hkey,"",reg_sz,"mypro","app.exename" _
    len(strconv(app.exename,vbformunicode))+1)
      

  4.   

    用程序实现的话,还是修改注册表,在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    下添加一项字符串类型的键,然后将键值设为你的程序的路径 
    用regsetvalueex函数
    dim hKey as long
    dim subkey as long
    subkey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
    hKey = regOpenKey(HKEY_LOCAL_MACHINE,subkey) ret =regsetvalueex(hkey,"",reg_sz,"mypro","app.exename" _
    len(strconv(app.exename,vbformunicode))+1)
      

  5.   

    用程序实现的话,还是修改注册表,在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    下添加一项字符串类型的键,然后将键值设为你的程序的路径 
    用regsetvalueex函数
    dim hKey as long
    dim subkey as string
    subkey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
    hKey = regOpenKey(HKEY_LOCAL_MACHINE,subkey)ret =regsetvalueex(hkey,"",reg_sz,"mypro","app.exename" _
    len(strconv(app.exename,vbformunicode))+1)