/*
How add your application to startup!
把你的程序添加到開機(jī)啟動項的方法
Author:K1u
作者:K1u
Site:k0h.org & k1u.org
網(wǎng)站:k0h.org & k1u.org
Disclaimer:I am not responsible for how you use this.
聲明:我對你怎么使用這個程序不負(fù)責(zé)
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或進(jìn)程文件名用GetModuleFileName()函數(shù)*/
TCHAR szPath[MAX_PATH];
GetModuleFileName(NULL,
szPath,
MAX_PATH);
/* Create a New HKEY.
創(chuàng)建一個鍵值*/
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僅對當(dāng)前用戶有效
current user only.
Now give a new value.
給鍵值賦新值
Syntax for RegSetValueEx() function is
RegSetValueEx()函數(shù)的調(diào)用方法為:
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.
關(guān)閉該鍵*/
RegCloseKey(newValue);
return 0;
}
英語翻譯
英語翻譯
編程達(dá)人就不用多說了,
英語達(dá)人請幫忙翻譯每一個從“/*”到“ */”中間的內(nèi)容
/*
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;
}
編程達(dá)人就不用多說了,
英語達(dá)人請幫忙翻譯每一個從“/*”到“ */”中間的內(nèi)容
/*
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;
}
其他人氣:542 ℃時間:2019-09-09 17:46:40
優(yōu)質(zhì)解答
我來回答
類似推薦
- 英語翻譯
- 求英語達(dá)人幫我解釋翻譯英語,謝謝~~~~
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 執(zhí)行下列程序段后,s的值為( ) s=5 for i=2.6 to 4.9 step o.6 s=s+1 next i 請問是怎么算的?
- 2倍根號5的平方怎么算!
- 用厚度為1厘米的玻璃做一個無蓋的正方體玻璃容器,棱長17厘米,如果在容器中注滿油,一共可裝多少毫升油.
- 甚么是物理有用功
- 甲、乙兩人沿400米環(huán)形跑道(同方向)競走,乙每分鐘走100米,甲的速度是乙的1.25倍,現(xiàn)在
- 用氫氧化鈉溶液除去鋁表面氧化膜 AL2O3+2OH-==2ALO2-+H2O 為什么不對?
- 小李現(xiàn)有一筆存款,他把每個月支出后剩余的錢都存入銀行.
猜你喜歡
- 1My friends all have have a good time.(同義句)
- 2一、已知方程x^2+2(m-2)x+m^2+4=0的兩個實數(shù)根的平方各比這兩個實數(shù)根的積大21,求m
- 3莊子主張順應(yīng)自然,提倡無為而無不為!
- 4若等差數(shù)列an的公差d不等于0,且a1,a3,a7成等比數(shù)列,則a2比a1等于多少 只要結(jié)果
- 5搶座這篇短文告訴我們一個什么道理
- 6舉一些例子說明怎樣減小摩擦力
- 7過去,這種機(jī)器被用來保持房間干燥用英語怎么說
- 8Mike doesn't piay sports.He only ( )them on tv
- 9合肥市2011年高三第三次教學(xué)質(zhì)量檢測文科綜合試題答案
- 10160×30+60x=120×(30-x)
- 11高一孔雀東南飛共多少句
- 12I‘m going to keep the classroom clan.(改為一般疑問句) _____ you _____ to keep the classroom clean?