00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "StdAfx.h"
00023 #include "Shareaza.h"
00024 #include "DlgAbout.h"
00025 #include "CoolInterface.h"
00026
00027 #ifdef _DEBUG
00028 #define new DEBUG_NEW
00029 #undef THIS_FILE
00030 static char THIS_FILE[] = __FILE__;
00031 #endif
00032
00033 BEGIN_MESSAGE_MAP(CAboutDlg, CSkinDialog)
00034
00035 ON_WM_PAINT()
00036 ON_WM_CTLCOLOR()
00037 ON_WM_SETCURSOR()
00038 ON_WM_LBUTTONDOWN()
00039 ON_WM_RBUTTONDOWN()
00040 ON_WM_CREATE()
00041
00042 END_MESSAGE_MAP()
00043
00044
00046
00047
00048 CAboutDlg::CAboutDlg(CWnd* pParent) : CSkinDialog(CAboutDlg::IDD, pParent)
00049 {
00050
00051
00052 }
00053
00054 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00055 {
00056 CSkinDialog::DoDataExchange(pDX);
00057
00058 DDX_Control(pDX, IDC_WEB, m_wndWeb);
00059 DDX_Control(pDX, IDC_TITLE, m_wndTitle);
00060
00061 }
00062
00064
00065
00066 BOOL CAboutDlg::OnInitDialog()
00067 {
00068 CSkinDialog::OnInitDialog();
00069
00070 SkinMe( _T("CAboutDlg"), IDR_MAINFRAME, FALSE );
00071
00072 CString strCaption;
00073
00074 GetWindowText( strCaption );
00075 strCaption += _T(" v");
00076 strCaption += theApp.m_sVersion;
00077 SetWindowText( strCaption );
00078
00079 m_wndTitle.GetWindowText( strCaption );
00080 strCaption += theApp.m_sVersion;
00081 m_wndTitle.SetWindowText( strCaption );
00082
00083 m_crWhite = CCoolInterface::GetDialogBkColor();
00084 m_brWhite.CreateSolidBrush( m_crWhite );
00085
00086 return TRUE;
00087 }
00088
00089 void CAboutDlg::OnPaint()
00090 {
00091 CPaintDC dc( this );
00092 CRect rc;
00093
00094 GetClientRect( &rc );
00095 rc.top += 51;
00096
00097 dc.Draw3dRect( 0, 50, rc.right + 1, 0,
00098 RGB( 128, 128, 128 ), RGB( 128, 128, 128 ) );
00099 dc.FillSolidRect( &rc, m_crWhite );
00100 }
00101
00102 HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
00103 {
00104 HBRUSH hbr = (HBRUSH)CSkinDialog::OnCtlColor( pDC, pWnd, nCtlColor );
00105
00106 pDC->SetBkColor( m_crWhite );
00107
00108 if ( pWnd == &m_wndTitle )
00109 {
00110 pDC->SelectObject( &theApp.m_gdiFontBold );
00111 }
00112 else if ( pWnd == &m_wndWeb )
00113 {
00114 pDC->SetTextColor( RGB( 0, 0, 255 ) );
00115 pDC->SelectObject( &theApp.m_gdiFontLine );
00116 }
00117
00118 return m_brWhite;
00119 }
00120
00121 BOOL CAboutDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
00122 {
00123 CPoint point;
00124 CRect rc;
00125
00126 GetCursorPos( &point );
00127 m_wndWeb.GetWindowRect( &rc );
00128
00129 if ( rc.PtInRect( point ) )
00130 {
00131 SetCursor( theApp.LoadCursor( IDC_HAND ) );
00132 return TRUE;
00133 }
00134
00135 return CSkinDialog::OnSetCursor( pWnd, nHitTest, message );
00136 }
00137
00138 void CAboutDlg::OnLButtonDown(UINT nFlags, CPoint point)
00139 {
00140 CSkinDialog::OnLButtonUp( nFlags, point );
00141
00142 CRect rc;
00143 m_wndWeb.GetWindowRect( &rc );
00144 ScreenToClient( &rc );
00145
00146 if ( rc.PtInRect( point ) )
00147 {
00148 ShellExecute( GetSafeHwnd(), _T("open"),
00149 _T("http://www.shareaza.com/?Version=") + theApp.m_sVersion,
00150 NULL, NULL, SW_SHOWNORMAL );
00151 }
00152 }
00153
00154 void CAboutDlg::OnRButtonDown(UINT nFlags, CPoint point)
00155 {
00156 CRect rc;
00157
00158 m_wndWeb.GetWindowRect( &rc );
00159 ScreenToClient( &rc );
00160
00161 if ( rc.PtInRect( point ) && ( GetAsyncKeyState( VK_SHIFT ) & 0x8000 ) )
00162 {
00163 DWORD* pNullPtr = (DWORD*)NULL;
00164 *pNullPtr = 0xFFFFFFFF;
00165 }
00166 }
00167
00168 int CAboutDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
00169 {
00170 if (CDialog::OnCreate(lpCreateStruct) == -1)
00171 return -1;
00172 return 0;
00173 }