]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/ExplorerPlugin/About.cpp
mDNSResponder-1310.80.1.tar.gz
[apple/mdnsresponder.git] / Clients / ExplorerPlugin / About.cpp
1 // About.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "ExplorerPlugin.h"
6 #include "About.h"
7 #include "WinVersRes.h"
8 #include <DebugServices.h>
9
10
11 // CAbout dialog
12
13 IMPLEMENT_DYNAMIC(CAbout, CDialog)
14 CAbout::CAbout(CWnd* pParent /*=NULL*/)
15 : CDialog(CAbout::IDD, pParent)
16 {
17 // Initialize brush with the desired background color
18 m_bkBrush.CreateSolidBrush(RGB(255, 255, 255));
19 }
20
21 CAbout::~CAbout()
22 {
23 }
24
25 void CAbout::DoDataExchange(CDataExchange* pDX)
26 {
27 CDialog::DoDataExchange(pDX);
28 DDX_Control(pDX, IDC_COMPONENT, m_componentCtrl);
29 DDX_Control(pDX, IDC_LEGAL, m_legalCtrl);
30 }
31
32
33 BEGIN_MESSAGE_MAP(CAbout, CDialog)
34 ON_WM_CTLCOLOR()
35 END_MESSAGE_MAP()
36
37
38 // CAbout message handlers
39 BOOL
40 CAbout::OnInitDialog()
41 {
42 BOOL b = CDialog::OnInitDialog();
43
44 CStatic * control = (CStatic*) GetDlgItem( IDC_ABOUT_BACKGROUND );
45 check( control );
46
47 if ( control )
48 {
49 control->SetBitmap( ::LoadBitmap( GetNonLocalizedResources(), MAKEINTRESOURCE( IDB_ABOUT ) ) );
50 }
51
52 control = ( CStatic* ) GetDlgItem( IDC_COMPONENT_VERSION );
53 check( control );
54
55 if ( control )
56 {
57 control->SetWindowText( TEXT( MASTER_PROD_VERS_STR2 ) );
58 }
59
60 return b;
61 }
62
63
64 HBRUSH CAbout::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
65 {
66 switch (nCtlColor)
67 {
68 case CTLCOLOR_STATIC:
69
70 if ( pWnd->GetDlgCtrlID() == IDC_COMPONENT )
71 {
72 pDC->SetTextColor(RGB(64, 64, 64));
73 }
74 else
75 {
76 pDC->SetTextColor(RGB(0, 0, 0));
77 }
78
79 pDC->SetBkColor(RGB(255, 255, 255));
80 return (HBRUSH)(m_bkBrush.GetSafeHandle());
81
82 case CTLCOLOR_DLG:
83
84 return (HBRUSH)(m_bkBrush.GetSafeHandle());
85
86 default:
87
88 return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
89 }
90 }