1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "object_viewer.h"
19 #include "about_dialog.h"
21 /////////////////////////////////////////////////////////////////////////////
22 // CAboutDialog dialog
25 CAboutDialog::CAboutDialog(CWnd
* pParent
/*=NULL*/)
26 : CDialog(CAboutDialog::IDD
, pParent
)
28 //{{AFX_DATA_INIT(CAboutDialog)
29 // NOTE: the ClassWizard will add member initialization here
34 void CAboutDialog::DoDataExchange(CDataExchange
* pDX
)
36 CDialog::DoDataExchange(pDX
);
37 //{{AFX_DATA_MAP(CAboutDialog)
38 // NOTE: the ClassWizard will add DDX and DDV calls here
43 BEGIN_MESSAGE_MAP(CAboutDialog
, CDialog
)
44 //{{AFX_MSG_MAP(CAboutDialog)
48 /////////////////////////////////////////////////////////////////////////////
49 // CAboutDialog message handlers
51 BOOL
CAboutDialog::OnInitDialog()
53 CDialog::OnInitDialog();
55 // Get the module path
56 HMODULE hModule
= AfxGetInstanceHandle();
57 nlassert(hModule
); // shouldn't be null now anymore in any case
58 nlassert(hModule
!= GetModuleHandle(NULL
)); // if this is dll, the module handle can't be same as exe
61 // Find the verion resource
62 HRSRC hRSrc
=FindResource (hModule
, MAKEINTRESOURCE(VS_VERSION_INFO
), RT_VERSION
);
65 HGLOBAL hGlobal
=LoadResource (hModule
, hRSrc
);
68 void *pInfo
=LockResource (hGlobal
);
73 if (VerQueryValue (pInfo
, _T("\\"), (void**)&versionTab
, &versionSize
))
75 // Get the pointer on the structure
76 VS_FIXEDFILEINFO
*info
= (VS_FIXEDFILEINFO
*)versionTab
;
78 // Setup version number
80 _stprintf (version
, _T("Version %d.%d.%d.%d"),
81 info
->dwFileVersionMS
>>16,
82 info
->dwFileVersionMS
&0xffff,
83 info
->dwFileVersionLS
>>16,
84 info
->dwFileVersionLS
&0xffff);
85 GetDlgItem (IDC_VERSION
)->SetWindowText (version
);
92 return TRUE
; // return TRUE unless you set the focus to a control
93 // EXCEPTION: OCX Property Pages should return FALSE