mfc设置程序开机自启动
2014-12-04 09:17
253 查看
程序初始化中加:
char system[MAX_PATH];
char pathtofile[MAX_PATH];
HMODULE GetModH = GetModuleHandle(NULL);
GetModuleFileName(GetModH,pathtofile,sizeof(pathtofile));
HKEY hKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey );
RegSetValueEx(hKey, "Writing to the Registry Example",
0,REG_SZ,(const unsigned char*)pathtofile,strlen(pathtofile));
RegCloseKey(hKey);
char system[MAX_PATH];
char pathtofile[MAX_PATH];
HMODULE GetModH = GetModuleHandle(NULL);
GetModuleFileName(GetModH,pathtofile,sizeof(pathtofile));
HKEY hKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey );
RegSetValueEx(hKey, "Writing to the Registry Example",
0,REG_SZ,(const unsigned char*)pathtofile,strlen(pathtofile));
RegCloseKey(hKey);
相关文章推荐
- linux 设置程序开机自启动的方法
- CentOS设置程序开机自启动的方法
- Linux设置程序开机自启动
- CentOS设置程序开机自启动的方法
- CentOS设置程序开机自启动的方法
- Fedora 16设置开机自启动程序与Ubuntu的区别
- linux_设置开机自启动程序脚本
- 【Linux】Linux设置程序开机自启动
- CentOS设置程序开机自启动的方法
- ubuntu下设置程序开机自启动的几种方法 分享
- fedora 17 设置开机自启动服务和程序
- CentOS设置程序开机自启动的方法
- tiny6410开机自启动QT4程序,并设置程序为全屏显示
- ubuntu下设置程序开机自启动 理解
- CentOS设置程序开机自启动的方法
- MFC 把自己写的程序设置成开机启动
- CentOS设置程序开机自启动的方法
- CentOS设置程序开机自启动的方法
- ubuntu设置开机自启动程序
- java程序,在windows下设置为开机自启动