ufaxwmw52.rar

  • Maqcvs
    了解作者
  • Visual C++
    开发工具
  • 7KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2018-05-16 12:37
    上传日期
Check if RAS is installed 检测RAS是否安装
ufaxwmw52.rar
  • res
  • Rasdetectcodeguru.ico
    1.1KB
  • Rasdetectcodeguru.rc2
    409B
  • RasdetectcodeguruDlg.cpp
    4.5KB
  • z6Rasdetectcodeguru.dsp
    4.3KB
  • StdAfx.cpp
    219B
  • resource.h
    557B
  • RasdetectcodeguruDlg.h
    1.4KB
  • pRasdetectcodeguru.dsw
    557B
  • Rf6Rasdetectcodeguru.h
    1.4KB
  • StdAfx.h
    999B
  • YRasdetectcodeguru.cpp
    2.1KB
  • Rasdetectcodeguru.rc
    4.5KB
内容介绍
// RasdetectcodeguruDlg.cpp : implementation file // #include "stdafx.h" #include "Rasdetectcodeguru.h" #include "RasdetectcodeguruDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CRasdetectcodeguruDlg dialog CRasdetectcodeguruDlg::CRasdetectcodeguruDlg(CWnd* pParent /*=NULL*/) : CDialog(CRasdetectcodeguruDlg::IDD, pParent) { //{{AFX_DATA_INIT(CRasdetectcodeguruDlg) m_output = _T("Press 'detect' to start the detection."); //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CRasdetectcodeguruDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRasdetectcodeguruDlg) DDX_Text(pDX, IDC_OUTPUT, m_output); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CRasdetectcodeguruDlg, CDialog) //{{AFX_MSG_MAP(CRasdetectcodeguruDlg) ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CRasdetectcodeguruDlg message handlers BOOL CRasdetectcodeguruDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void CRasdetectcodeguruDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CRasdetectcodeguruDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } void CRasdetectcodeguruDlg::OnOK() { int result = 0; result = RasDetect(); if(result == -666) m_output = "Unable to detect your OS and OS version."; else if(result == -1) m_output = "Unable to open the desired registry keys."; else if(result == 0) m_output = "There is no RAS installed."; else if(result == 1) m_output = "You have RAS installed."; else m_output = "Wow! You managed to get an impossible result!!\r\nCongratulations."; UpdateData(false); } int RasDetect(void) { HKEY registry = NULL;; DWORD result; OSVERSIONINFO version; char regkey[70]; /* First we have to find out which OS we are running on */ version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); /* If we get and error, we can't continue. */ if(!GetVersionEx(&version)) return -666; /* Then we set the registry key we want to look at, according to the OS we detected. */ if(version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) strcpy(regkey,"system\\currentcontrolset\\services\\remoteaccess\\networkprovider"); else if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) strcpy(regkey,"system\\currentcontrolset\\services\\remoteaccess"); /* We then try to open the registry key */ if((result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,regkey,0,STANDARD_RIGHTS_READ|KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS|KEY_NOTIFY|READ_CONTROL,&registry)) != ERROR_SUCCESS) { /* If we have NO success, but also not 'file not found error', we have encountered another error. */ if(result != ERROR_FILE_NOT_FOUND) { RegCloseKey(registry); return -1; /* Else we got an error and it was the 'file not found', telling us that that registry */ /* key does not exist and we can conclude that the RAS has not been installed. */ } else { RegCloseKey(registry); return 0; } } /* If all goes well, we find the key we were looking for. This tells us that there is */ /* RAS installed on this machine. */ RegCloseKey(registry); return 1; }
评论
    相关推荐
    • k-means.zip
      利用k-means算法进行图像分割,很厉害的算法,不过还有改进的空间
    • k.rar
      多表替代密码实现,有加密解密过程,c++实现
    • K_Average.zip
      通过k-近邻法将点分成两类,错误率较低,该方法效果挺好
    • K_means.zip
      K均值聚类算法 属于模式识别的一种基本算法 在此没有与opencv关联
    • b.rar
      实现基本的L-K光流算法的matlab仿真(主函数和自定义函数)
    • K_AVERAGE.zip
      模式识别K均值处理,程序经过自己修改,可以运行
    • OTSU.rar
      matlab实现的最大类间方差OTSU的功能。
    • k-mean.rar
      影像k-mean分类,也是上传的别人的,有实验的例子,数据,希望对各位有用。
    • Array.rar
      java程序员面试宝典中关于数组的相关操作,包括数组的排序,数组中最小数字的查找,求数组中第K个最小的数,求数组中和为某数值的两个数等
    • qpopper2.53.tar.Z
      pop3 server