-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAboutWeb.cpp
More file actions
76 lines (65 loc) · 1.75 KB
/
Copy pathAboutWeb.cpp
File metadata and controls
76 lines (65 loc) · 1.75 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
// AboutWeb.cpp : implementation file
//
#include "stdafx.h"
#include "onstation.h"
#include "AboutWeb.h"
#include "winreg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutWeb property page
IMPLEMENT_DYNCREATE(CAboutWeb, CPropertyPage)
CAboutWeb::CAboutWeb() : CPropertyPage(CAboutWeb::IDD)
{
//{{AFX_DATA_INIT(CAboutWeb)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
HKEY hKey;
LONG lValue=RegOpenKeyEx(HKEY_CLASSES_ROOT,"htmlfile\\shell\\open\\command",0,KEY_READ,&hKey);
m_szBrowser="";
if (lValue==ERROR_SUCCESS)
{
DWORD dwType;
DWORD dwDataSize=256;
char byData[512];
if (RegQueryValueEx(hKey,"",NULL,&dwType,(LPBYTE)byData,&dwDataSize)==ERROR_SUCCESS)
{
m_szBrowser=byData;
}
}
}
CAboutWeb::~CAboutWeb()
{
}
void CAboutWeb::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutWeb)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutWeb, CPropertyPage)
//{{AFX_MSG_MAP(CAboutWeb)
ON_BN_CLICKED(IDC_BUTTON1, OnHome)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAboutWeb message handlers
void CAboutWeb::OnHome()
{
if (m_szBrowser.GetLength()>1)
{
char szBuffer[512];
lstrcpyn(szBuffer,m_szBrowser,sizeof(szBuffer)-1);
lstrcat(szBuffer," http://members.home.net/tacovan/index.html");
WinExec(szBuffer,SW_SHOWNORMAL);
}
else
{
AfxMessageBox(IDS_NOBROWSER);
}
// TODO: Add your control notification handler code here
}