-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbkemulabout.cpp
More file actions
76 lines (66 loc) · 2.26 KB
/
bkemulabout.cpp
File metadata and controls
76 lines (66 loc) · 2.26 KB
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
#include "stdafx.h"
#include "bkemulabout.h"
#include "resource.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// ----------------------------------------------------------------------------
// ---------- BKEmulAbout
// ----------------------------------------------------------------------------
BEGIN_MESSAGE_MAP(BKEmulAbout, CDialog)
//{{AFX_MSG_MAP(BKEmulAbout)
//}}AFX_MSG_MAP
ON_NOTIFY( NM_RDOLINK_CLICK, IDC_EMAIL_STATIC, OnEMailClick )
END_MESSAGE_MAP()
BKEmulAbout::BKEmulAbout( CWnd* pParent ): CDialog( IDD_ABOUT, pParent )
{
//{{AFX_DATA_INIT(BKEmulAbout)
//}}AFX_DATA_INIT
}
void BKEmulAbout::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(BKEmulAbout)
//}}AFX_DATA_MAP
DDX_Control( pDX, IDC_EMAIL_STATIC, email );
}
BOOL BKEmulAbout::OnInitDialog()
{
CDialog::OnInitDialog();
TCHAR szExeName[ MAX_PATH + 1 ];
if ( ::GetModuleFileName( NULL, szExeName, MAX_PATH ) ) {
DWORD dwHnd;
DWORD size = ::GetFileVersionInfoSize( szExeName, &dwHnd );
if ( size ) {
void* pBuffer = malloc( size );
if ( pBuffer != NULL ) {
if ( ::GetFileVersionInfo( szExeName, dwHnd, size, pBuffer ) ) {
DWORD* pTranslation;
UINT length;
if ( ::VerQueryValue( pBuffer, _T("\\VarFileInfo\\Translation"), (void**)&pTranslation, &length ) ) {
DWORD translation = *pTranslation;
char key[2000];
wsprintf( key, _T("\\StringFileInfo\\%04x%04x\\ProductName"), LOWORD( translation ), HIWORD( translation ) );
char* productName;
if ( ::VerQueryValue( pBuffer, key, (void**)&productName, &length ) ) {
VS_FIXEDFILEINFO* fixedInfo;
if ( ::VerQueryValue( pBuffer, _T("\\"), (void**)&fixedInfo, &length ) ) {
GetDlgItem( IDC_BUILD_STATIC )->SetWindowText( format( "%s version %u.%u (build %u)", productName, HIWORD( fixedInfo->dwProductVersionMS ), LOWORD( fixedInfo->dwProductVersionMS ), LOWORD( fixedInfo->dwProductVersionLS ) ).c_str() );
}
}
}
}
free( pBuffer );
}
}
}
email.setTextColor( RGB(0x00, 0x40, 0x80) );
return TRUE;
}
void BKEmulAbout::OnEMailClick( NMHDR* /*pNotifyStruct*/, LRESULT* result )
{
::ShellExecute( m_hWnd, "open", "mailto:andrewu@mail.ru", 0, 0, SW_SHOWNORMAL );
*result = 0;
}