vc 写注册表设置程序自动启动
来源:互联网 发布:power dvd mac 编辑:程序博客网 时间:2024/05/16 05:56
BOOL SetAutoRun(CString strPath)//开机自动运行
{
CString str;
HKEY hRegKey;
BOOL bResult;
str=_T("Software//Microsoft//Windows//CurrentVersion//Run");
if(RegOpenKey(HKEY_LOCAL_MACHINE, str, &hRegKey) != ERROR_SUCCESS)
bResult=FALSE;
else
{
_splitpath(strPath.GetBuffer(0),NULL,NULL,str.GetBufferSetLength(MAX_PATH+1),NULL);
strPath.ReleaseBuffer();
str.ReleaseBuffer();
if(::RegSetValueEx( hRegKey,
str,
0,
REG_SZ,
(CONST BYTE *)strPath.GetBuffer(0),
strPath.GetLength() ) != ERROR_SUCCESS)
bResult=FALSE;
else
bResult=TRUE;
strPath.ReleaseBuffer();
}
return bResult;
}
CString GetMyPath()
{
CString strPath;
GetModuleFileName(NULL,strPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
strPath.ReleaseBuffer();
return strPath;
}
- vc 写注册表设置程序自动启动
- vc修改注册表开机自动启动程序
- VC设置注册表启动项目
- vc++写注册表自启动( 转)
- 写注册表设置开机启动的代码
- 写注册表设置开机启动的代码
- 修改注册表开机自动启动程序
- 修改注册表开机自动启动程序
- VC 中设置程序 开机自动启动和取消自动启动
- 通过设置注册表使得启动ZWCAD时自动加载.net程序
- VC++程序开机自动启动
- 修改注册表设置程序启动项
- VC++修改注册表使应用程序实现开机自动启动
- VC++读、写注册表
- [NSIS] 程序自动启动设置
- wince 自动启动程序设置
- wince 自动启动程序设置
- wince 自动启动程序设置
- 35岁前要把下面10件事做好
- ubuntu svn server setup
- JAVA读文件,并转为String类型源码示例
- Linux 串口编程中遇到的问题
- ThinkPHP SQL查询
- vc 写注册表设置程序自动启动
- Xlib: connection to ":0.0" refused by server...解决办法
- 11
- 浅谈.net Ajax的无刷新技术实例详解
- Linux操作系统里查看所有用户
- struts2 学习笔记- 传智播客 2010-9-17
- 独家分析JSP、PHP和JAVA融合的研发环境
- iframe里面的页面调用父窗口,左右窗口js函数的方法
- 工厂方法模式(Factory Method)