summaryrefslogtreecommitdiffstats
path: root/mDNSResponder/Clients/ExplorerPlugin/About.cpp
blob: 4a63f2c25d4888852645ad575062e226c612fdf2 (plain) (blame)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// About.cpp : implementation file
//

#include "stdafx.h"
#include "ExplorerPlugin.h"
#include "About.h"
#include "WinVersRes.h"
#include <DebugServices.h>


// CAbout dialog

IMPLEMENT_DYNAMIC(CAbout, CDialog)
CAbout::CAbout(CWnd* pParent /*=NULL*/)
	: CDialog(CAbout::IDD, pParent)
{
	// Initialize brush with the desired background color
	m_bkBrush.CreateSolidBrush(RGB(255, 255, 255));
}

CAbout::~CAbout()
{
}

void CAbout::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_COMPONENT, m_componentCtrl);
	DDX_Control(pDX, IDC_LEGAL, m_legalCtrl);
}


BEGIN_MESSAGE_MAP(CAbout, CDialog)
ON_WM_CTLCOLOR()
END_MESSAGE_MAP()


// CAbout message handlers
BOOL
CAbout::OnInitDialog()
{
	BOOL b = CDialog::OnInitDialog();

	CStatic * control = (CStatic*) GetDlgItem( IDC_ABOUT_BACKGROUND );
	check( control );

	if ( control )
	{
		control->SetBitmap( ::LoadBitmap( GetNonLocalizedResources(), MAKEINTRESOURCE( IDB_ABOUT ) ) );
	}

	control = ( CStatic* ) GetDlgItem( IDC_COMPONENT_VERSION );
	check( control );

	if ( control )
	{
		control->SetWindowText( TEXT( MASTER_PROD_VERS_STR2 ) );
	}

	return b;
}


HBRUSH CAbout::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{ 
	switch (nCtlColor)
	{
		case CTLCOLOR_STATIC:
	
			if ( pWnd->GetDlgCtrlID() == IDC_COMPONENT )
			{
				pDC->SetTextColor(RGB(64, 64, 64));
			}
			else
			{
				pDC->SetTextColor(RGB(0, 0, 0));
			}

			pDC->SetBkColor(RGB(255, 255, 255));
			return (HBRUSH)(m_bkBrush.GetSafeHandle());

		case CTLCOLOR_DLG:
	
			return (HBRUSH)(m_bkBrush.GetSafeHandle());

		default:
	
			return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	}
}