/*
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;
}
英语翻译
英语翻译
编程达人就不用多说了,
英语达人请帮忙翻译每一个从“/*”到“ */”中间的内容
/*
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: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;
}
其他人气:795 ℃时间:2019-09-09 17:46:40
优质解答
我来回答
类似推荐
猜你喜欢
- 1某行星和地球绕太阳公转的轨道均可视为圆.每过N年,该行星会运行到日地连线的延长线上,如图所示.该行星与地球的公转半径比为( ) A.(N+1N) 23 B.(NN−1) 23 C.(N+1N) 32 D.(NN−1) 32
- 2鲁宾逊漂流记英语主要内容
- 3英语各种时态的结构,像是现在完成时,过去完成时那种
- 4填空 1写出两个含有近义词的成语 2写出两个含有反义词的成语 3( )然若失 ( )然无存 ( )然泪下
- 5已知函数y=log1/2(3X^2-aX+5)实数a的取值范围是?
- 6小明每小时打字40个小刚打字的时间是小明的60%同样的速度小刚打字的是小明的百分之多少?
- 7如果函数y=x-2与y=-2x+4的图象的交点坐标是(2,0),那么二元一次方程组x−y=22x+y=4的解是_.
- 8Walk ____ (径直地)on ___(down)the road , and you'll see a tall building.
- 9什么叫动词一般现在时第三人称单数?
- 10作文《月考小结》怎么写