📄 setupcheck.h
字号:
// SetupCheck.h: interface for the CSetup class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SETUP_H__2B33D19E_24CB_4CE4_82FB_21200F6BEA73__INCLUDED_)
#define AFX_SETUP_H__2B33D19E_24CB_4CE4_82FB_21200F6BEA73__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "stdafx.h"
#include <direct.h>
#include "Regkey.h"
#define WIN_VERSION_WINS 0x0000
#define WIN_VERSION_95 0x0001
#define WIN_VERSION_98 0x0010
#define WIN_VERSION_NT4_WORKSTATION 0x0100
#define WIN_VERSION_NT4_SERVER 0x1000
#define WIN_VERSION_2000_WORKSTATION 0x1100
#define WIN_VERSION_2000_SERVER 0x1111
/*
安装函数类
完成一些安装程序过程的操作函数的集合
整理:邓振波(seesi)
EMail:seesi@163.com
主页:seesi.top263.net
编译环境:VC6+SP5+Win2000
代码可以任意COPY,请保留说明
*/
class CSetup
{
public:
int GetWindowsVersion(CString& strVersion,WORD& wLangage,WORD& wCodePage);//得到Windows的版本,返回值为版本,参数返回具体的语言信息
BOOL RegistrActiveServer(LPCSTR lpszOcxFileName,BOOL bRegister=TRUE);//注册OCX控件
BOOL IsServer(); //系统是否Serve版
BOOL CheckWindowVersion(BOOL& bNT,DWORD& dwMajor,DWORD& dwMinor);//检测Windows的版本信息
BOOL IsNT();//系统是否Windows NT
BOOL IsWin2000();//系统是否Win200
BOOL IsWinNT4();//系统是否NT4
BOOL IsWinNT351();//保留没用,统一要求系统的版本为NT4以上
BOOL IsWindows98();//系统是否98及以上
BOOL IsWindows95();//系统是否95及其它
UINT GetTempFileName(CString& strUniquName,LPCSTR lpPrefixString=NULL);//得到唯一的临时文件名
DWORD GetSysTempPath(CString& strTempPath);//得到系统临时目录
LONG RegWriteData(LPCTSTR pszSection, LPCTSTR pszEntry, const BYTE* btVal, DWORD dwLength,HKEY hKey=HKEY_LOCAL_MACHINE);//往注册表写数据
LONG RegWriteLong(LPCTSTR pszSection, LPCTSTR pszEntry, DWORD dwVal, HKEY hKey=HKEY_LOCAL_MACHINE);//往注册表写整数
LONG RegWriteString(LPCTSTR pszSection, LPCTSTR pszEntry, LPCSTR pszVal, HKEY hKey=HKEY_LOCAL_MACHINE);//往注册表写字符串
LONG RegReadData(LPCTSTR pszSection, LPCTSTR pszEntry, BYTE* btVal,DWORD dwLength, HKEY hKey=HKEY_LOCAL_MACHINE);//从注册表读数据
BOOL DeleteKey(LPCTSTR pszSubKey,LPCTSTR pszValueName,HKEY hKey=HKEY_LOCAL_MACHINE);//删除注册表的键值,pszValueName不为空则整个Key下面的所有键值均删
LONG RegReadLong(LPCTSTR pszSection, LPCTSTR pszEntry, DWORD &dwVal, HKEY hKey=HKEY_LOCAL_MACHINE);//从注册表里读取整数
LONG RegReadString(LPCTSTR pszSection,LPCTSTR pszEntry, CString& sVal,HKEY hKey=HKEY_LOCAL_MACHINE);//从注册表里读取字符串
DWORD GetMemorySize(CString& strDecriSzie);//得到内存大小
BOOL GetDriverFreeSpace(char chDriver,CString& strDescript);//得到磁盘剩余空间
BOOL ShutDownComputer(UINT uFlag=EWX_REBOOT);//重起或关闭计算机
BOOL CreateProcess(LPSTR lpszFileName);//执行一个程序
BOOL ShellExecuteEx(LPCSTR lpsFileName,LPCSTR lpszParam=NULL,LPCSTR lpszMode="OPEN");//执行某些文件或程序
BOOL CreateShortCutOnDesktop(LPCSTR lpszFullPathName,LPCSTR lpszLinkName);//桌面建立快捷方式
BOOL CreateShortCutOnProgramGroup(LPCSTR lpszFullPathName,LPCSTR lpszLinkName);//开始菜单建立快捷方式
BOOL CreateShortCut(const CString strSrcPath,const CString strPathLink);//建立快捷方式
BOOL DeleteFolder(LPCSTR lpzsFolderName,DWORD dwDelFlags=0);//删除文件夹
BOOL AddToStartup(LPCSTR lpszFullFilePath,BOOL bRunOnce=FALSE);//添加随计算机启动而启动程序
BOOL CreatePath(LPCSTR lpszFullPathName);//建立目录
BOOL GetStartupPath(CString &strPath);//得到启动目录
BOOL GetDesktopPath(CString& strPath);//得到桌面路径
BOOL GetProgramGroupPath(CString& strPath);//得到程序组路径
BOOL GetWindowsPath(CString& strWinPath,CString& strWinSysPath);//得到Windows目录
BOOL DeleteFile(LPCSTR lpszFileName);//删除文件
BOOL CopyFile(LPCSTR lpszSrc,LPCSTR lpszDec,DWORD dwFlag=FOF_ALLOWUNDO|FOF_SILENT);//复制文件
CSetup();
BOOL SetupCheckIEVersion(int& MajorVersion,int& MinorVersion);//检测IE的版本
virtual ~CSetup();
private:
//_SQLServerPtr spSQLServer;
CRegKey m_regKey; //注册表操作
DWORD m_dwVersion; //用于判断版本
BOOL m_bNT;
public:
int StartupAtRoot(LPCTSTR lpszName,LPCTSTR lpszExeFile,HKEY nRootKey=NULL);////程序启动而启动
DWORD m_dwWinVerMajor;//系统版本
DWORD m_dwWinVerMinor;//系统版本
};
#endif // !defined(AFX_SETUP_H__2B33D19E_24CB_4CE4_82FB_21200F6BEA73__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -