| 发表于:2007-04-11 17:55:585楼 得分:0 |
programart_life(理论派) 说的对 我看你的意思是要打开 "software\microsoft\windows\currentversion\run\ "这个健, 然后向里面写入 计算机启动后自动运行的程序的名字吧? 那么还需要另外的函数才能做的。 例如:我想把计算机日期格式改为 "yyyy-mm-dd " option explicit private declare function regclosekey lib "advapi32.dll " (byval hkey as long) as long private declare function regopenkeyex lib "advapi32.dll " alias "regopenkeyexa " _ (byval hkey as long, byval lpsubkey as string, byval uloptions as long, byval samdesired as long, phkresult as long) _ as long private declare function regsetvalueex lib "advapi32.dll " alias "regsetvalueexa " _ (byval hkey as long, byval lpvaluename as string, byval reserved as long, byval dwtype as long, _ lpdata as any, byval cbdata as long) as long private const hkey_current_user = &h80000001 private const reg_sz = 1 ' unicode nul terminated string private const error_success = 0& const key_all_access = &h3f const reg1 = "control panel\international " private phkresult as long private sub command1_click() dim back as long dim updata as double dim dateformat as string dateformat = "yyyy-mm-dd " back = regopenkeyex(hkey_current_user, reg1, 0&, key_all_access, phkresult) back = regsetvalueex(phkresult, "sshortdate ", 0&, reg_sz, byval dateformat, lenb(dateformat)) regclosekey (phkresult) '当然,这里还要通知系统格式变了,我省略了 end sub | | |
|