-
Notifications
You must be signed in to change notification settings - Fork 0
/
PInfoDlg.cpp
76 lines (60 loc) · 1.45 KB
/
PInfoDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// PInfoDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ShellExec.h"
#include "PInfoDlg.h"
// CPInfoDlg dialog
IMPLEMENT_DYNAMIC(CPInfoDlg, CDialog)
CPInfoDlg::CPInfoDlg(HANDLE hProcess, CWnd* pParent /*=NULL*/)
: CDialog(CPInfoDlg::IDD, pParent), m_hProcess( hProcess )
{
}
CPInfoDlg::~CPInfoDlg()
{
}
void CPInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DWORD_PTR dwVal = reinterpret_cast<DWORD_PTR>( m_hProcess );
DDX_Text(pDX, IDC_HPROCESS, dwVal );
}
BEGIN_MESSAGE_MAP(CPInfoDlg, CDialog)
ON_BN_CLICKED(IDOK, OnBnClickedOk)
END_MESSAGE_MAP()
// CPInfoDlg message handlers
void CPInfoDlg::OnBnClickedOk()
{
DWORD ExitCode;
if ( GetExitCodeProcess( m_hProcess, &ExitCode ) )
{
if ( ExitCode == STILL_ACTIVE )
{
SetDlgItemText( IDC_GECP_VALUE, _T("Still Active") );
}
else
{
TCHAR szValue[sizeof("0x12341234")];
szValue[0] = '0';
szValue[1] = 'x';
#if _MSC_VER < 1400
_itot( ExitCode, &szValue[2], 16 );
#else
_itot_s( ExitCode, &szValue[2], _countof(szValue)-2, 16 );
#endif
SetDlgItemText( IDC_GECP_VALUE, szValue );
}
}
else
{
SetDlgItemText( IDC_GECP_VALUE, _T("Failed!") );
}
}
BOOL CPInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
/* Do an initial update of the information */
OnBnClickedOk();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}