Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dravion authored Aug 4, 2017
1 parent cd451a8 commit 598bc1c
Show file tree
Hide file tree
Showing 27 changed files with 4,581 additions and 0 deletions.
28 changes: 28 additions & 0 deletions HMSInfo.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HMSInfo", "HMSInfo\HMSInfo.vcxproj", "{8B442DB4-D5A2-4751-B441-79C5720A0CEE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8B442DB4-D5A2-4751-B441-79C5720A0CEE}.Debug|x64.ActiveCfg = Debug|x64
{8B442DB4-D5A2-4751-B441-79C5720A0CEE}.Debug|x64.Build.0 = Debug|x64
{8B442DB4-D5A2-4751-B441-79C5720A0CEE}.Debug|x86.ActiveCfg = Debug|Win32
{8B442DB4-D5A2-4751-B441-79C5720A0CEE}.Debug|x86.Build.0 = Debug|Win32
{8B442DB4-D5A2-4751-B441-79C5720A0CEE}.Release|x64.ActiveCfg = Release|x64
{8B442DB4-D5A2-4751-B441-79C5720A0CEE}.Release|x64.Build.0 = Release|x64
{8B442DB4-D5A2-4751-B441-79C5720A0CEE}.Release|x86.ActiveCfg = Release|Win32
{8B442DB4-D5A2-4751-B441-79C5720A0CEE}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
46 changes: 46 additions & 0 deletions HMSInfo/CredentialsFrm.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include "stdafx.h"
#include "HMSInfo.h"
#include "CredentialsFrm.h"
#include "afxdialogex.h"


IMPLEMENT_DYNAMIC(CredentialsFrm, CDialogEx)

CredentialsFrm::CredentialsFrm(CWnd* pParent /*=NULL*/)
: CDialogEx(IDD_CredentialsFrm, pParent)
{
}

CredentialsFrm::~CredentialsFrm()
{
}

void CredentialsFrm::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
SetDlgItemText(IDC_ed_username, L"Administrator");
DDX_Control(pDX, IDC_ed_username, ed_username);
DDX_Control(pDX, IDC_ed_password, ed_password);

HWND hWnd;
GetDlgItem(IDC_ed_password, &hWnd);
::PostMessage(hWnd, WM_SETFOCUS, 0, 0);

}

BEGIN_MESSAGE_MAP(CredentialsFrm, CDialogEx)
ON_COMMAND(IDOK, OnOK)
ON_BN_CLICKED(IDOK, &CredentialsFrm::OnBnClickedOk)
END_MESSAGE_MAP()

void CredentialsFrm::OnOK()
{
this->ed_username.GetWindowTextW(hUsr);
this->ed_password.GetWindowTextW(hPwd);
CDialogEx::OnOK();
}

void CredentialsFrm::OnBnClickedOk()
{
CDialogEx::OnOK();
}
33 changes: 33 additions & 0 deletions HMSInfo/CredentialsFrm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#pragma once
#include "afxwin.h"


// CredentialsFrm dialog

class CredentialsFrm : public CDialogEx
{
DECLARE_DYNAMIC(CredentialsFrm)

public:
CredentialsFrm(CWnd* pParent = nullptr); // standard constructor
virtual ~CredentialsFrm();

// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_CredentialsFrm };
#endif

protected:
void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support

DECLARE_MESSAGE_MAP()
public:
CEdit ed_username;
CEdit ed_password;
CString hPwd;
CString hUsr;
//afx_msg void bt_scan();
//afx_msg void OnEnChangeedusername();
void OnOK() override;
afx_msg void OnBnClickedOk();
};
108 changes: 108 additions & 0 deletions HMSInfo/HMSInfo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@

// HMSInfo.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "HMSInfo.h"
#include "HMSInfoDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CMainApp

BEGIN_MESSAGE_MAP(CMainApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()


// CMainApp construction

CMainApp::CMainApp()
{
// support Restart Manager
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;

// TODO: add construction code here,
// Place all significant initialization in InitInstance
}


// The one and only CMainApp object

CMainApp theApp;


// CMainApp initialization

BOOL CMainApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll Version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);

CWinApp::InitInstance();

if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}


AfxEnableControlContainer();

// Create the shell manager, in case the dialog contains
// any shell tree view or shell list view controls.
CShellManager *pShellManager = new CShellManager;

// Activate "Windows Native" visual manager for enabling themes in MFC controls
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));

CHMSInfoDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
else if (nResponse == -1)
{
TRACE(traceAppMsg, 0, "Warning: dialog creation failed, so application is terminating unexpectedly.\n");
TRACE(traceAppMsg, 0, "Warning: if you are using MFC controls on the dialog, you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.\n");
}

// Delete the shell manager created above.
if (pShellManager != NULL)
{
delete pShellManager;
}

// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

32 changes: 32 additions & 0 deletions HMSInfo/HMSInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

// HMSInfo.h : main header file for the PROJECT_NAME application
//

#pragma once

#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif

#include "resource.h" // main symbols


// CMainApp:
// See HMSInfo.cpp for the implementation of this class
//

class CMainApp : public CWinApp
{
public:
CMainApp();

// Overrides
public:
virtual BOOL InitInstance();

// Implementation

DECLARE_MESSAGE_MAP()
};

extern CMainApp theApp;
Binary file added HMSInfo/HMSInfo.rc
Binary file not shown.
Loading

0 comments on commit 598bc1c

Please sign in to comment.