英语翻译编程达人就不用多说了,英语达人请帮忙翻译每一个从“/*”到“ */”中间的内容/* How add your application to startup!Author:K1uSite:k0h.org & k1u.orgDisclaimer:I am not responsible for how you use this.This is p
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/06 18:50:33
![英语翻译编程达人就不用多说了,英语达人请帮忙翻译每一个从“/*”到“ */”中间的内容/* How add your application to startup!Author:K1uSite:k0h.org & k1u.orgDisclaimer:I am not responsible for how you use this.This is p](/uploads/image/z/4290602-50-2.jpg?t=%E8%8B%B1%E8%AF%AD%E7%BF%BB%E8%AF%91%E7%BC%96%E7%A8%8B%E8%BE%BE%E4%BA%BA%E5%B0%B1%E4%B8%8D%E7%94%A8%E5%A4%9A%E8%AF%B4%E4%BA%86%2C%E8%8B%B1%E8%AF%AD%E8%BE%BE%E4%BA%BA%E8%AF%B7%E5%B8%AE%E5%BF%99%E7%BF%BB%E8%AF%91%E6%AF%8F%E4%B8%80%E4%B8%AA%E4%BB%8E%E2%80%9C%2F%2A%E2%80%9D%E5%88%B0%E2%80%9C+%2A%2F%E2%80%9D%E4%B8%AD%E9%97%B4%E7%9A%84%E5%86%85%E5%AE%B9%2F%2A+How+add+your+application+to+startup%21Author%3AK1uSite%3Ak0h.org+%26+k1u.orgDisclaimer%3AI+am+not+responsible+for+how+you+use+this.This+is+p)
英语翻译编程达人就不用多说了,英语达人请帮忙翻译每一个从“/*”到“ */”中间的内容/* How add your application to startup!Author:K1uSite:k0h.org & k1u.orgDisclaimer:I am not responsible for how you use this.This is p
英语翻译
编程达人就不用多说了,
英语达人请帮忙翻译每一个从“/*”到“ */”中间的内容
/*
How add your application to startup!
Author:K1u
Site:k0h.org & k1u.org
Disclaimer:I am not responsible for how you use this.
This is purely for educational purposes.
BTW:If you wish to use this in your application give me a shout.
*/
#include
int main(void)
{
/* Grab filename of process/exe using GetModuleFileName() function.*/
TCHAR szPath[MAX_PATH];
GetModuleFileName(NULL,
szPath,
MAX_PATH);
/* Create a New HKEY.*/
HKEY newValue;
/* Open Registry key.*/
RegOpenKey(HKEY_LOCAL_MACHINE,
"Software\\Microsoft\\Windows\\CurrentVersion\\Run",
&newValue);
/* Note use HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run to add for the
current user only.
Now give a new value.
Syntax for RegSetValueEx() function is
LONG WINAPI RegSetValueEx(
__in HKEY hKey,
__in_opt LPCTSTR lpValueName,
__reserved DWORD Reserved,
__in DWORD dwType,
__in_opt const BYTE* lpData,
__in DWORD cbData
);
RegSetValueEx(newValue,
"Name_Me_Please",
0,
REG_SZ,
(LPBYTE)szPath,
sizeof(szPath));
/* Close the key.*/
RegCloseKey(newValue);
return 0;
}
英语翻译编程达人就不用多说了,英语达人请帮忙翻译每一个从“/*”到“ */”中间的内容/* How add your application to startup!Author:K1uSite:k0h.org & k1u.orgDisclaimer:I am not responsible for how you use this.This is p
/*
How add your application to startup!
把你的程序添加到开机启动项的方法
Author:K1u
作者:K1u
Site:k0h.org & k1u.org
网站:k0h.org & k1u.org
Disclaimer:I am not responsible for how you use this.
声明:我对你怎么使用这个程序不负责
This is purely for educational purposes.
这单纯的只是教育目的
BTW:If you wish to use this in your application give me a shout.
另:如果要用在你的程序里,跟我打声招呼
*/
#include
int main(void)
{
/* Grab filename of process/exe using GetModuleFileName() function.
获取exe或进程文件名用GetModuleFileName()函数*/
TCHAR szPath[MAX_PATH];
GetModuleFileName(NULL,
szPath,
MAX_PATH);
/* Create a New HKEY.
创建一个键值*/
HKEY newValue;
/* Open Registry key.
打开注册表中的键*/
RegOpenKey(HKEY_LOCAL_MACHINE,
"Software\\Microsoft\\Windows\\CurrentVersion\\Run",
&newValue);
/* Note use HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run to add for the
注意:HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run仅对当前用户有效
current user only.
Now give a new value.
给键值赋新值
Syntax for RegSetValueEx() function is
RegSetValueEx()函数的调用方法为:
LONG WINAPI RegSetValueEx(
__in HKEY hKey,
__in_opt LPCTSTR lpValueName,
__reserved DWORD Reserved,
__in DWORD dwType,
__in_opt const BYTE* lpData,
__in DWORD cbData
);
RegSetValueEx(newValue,
"Name_Me_Please",
0,
REG_SZ,
(LPBYTE)szPath,
sizeof(szPath));
/* Close the key.
关闭该键*/
RegCloseKey(newValue);
return 0;
}