英语翻译编程达人就不用多说了,英语达人请帮忙翻译每一个从“/*”到“ */”中间的内容/* 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/04/29 02:29:28
英语翻译编程达人就不用多说了,英语达人请帮忙翻译每一个从“/*”到“ */”中间的内容/* 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: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;
}