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