home *** CD-ROM | disk | FTP | other *** search
- // wltestc.cpp : Defines the class behaviors for the application.
- //
-
- #include "stdafx.h"
- #include "wltestc.h"
- #include "maindlg.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- CWLTestApp NEAR theApp; // the one and only CWLTestApp object
-
- /////////////////////////////////////////////////////////////////////////////
- // CWLTestApp static members.
-
- const char *CWLTestApp::m_pszBrowserAPIs[] = {
- "GetWindowInfo",
- "ListWindows",
- "ActivateWindow",
- "CloseWindow",
- "SetWindowPos",
- "ShowWindow",
- "ShowFile",
- "OpenURL",
- "SaveURL",
- "PostFormData",
- "SaveFormData",
- "RegisterProtocol",
- "UnregisterProtocol",
- "RegisterURLEcho",
- "UnregisterURLEcho",
- "RegisterViewer",
- "UnregisterViewer",
- "RegisterWindowChange",
- "UnregisterWindowChange",
- "ParseAnchor",
- "GetVersion",
- "QueryURLFile",
- "SetNotifyMethod",
- NULL
- };
-
- const char *CWLTestApp::m_pszToolbarAPIs[] = {
- "IsToolbarActive",
- "SetActiveToolbar",
- "AddToolbarButton",
- "RemoveToolbarButton",
- "IsToolbarButtonVisible",
- "ShowToolbarButton",
- "EnableToolbarButton",
- "IsToolbarButtonEnabled",
- "GetToolbarText",
- "SetToolbarText",
- "GetToolbarFont",
- "SetToolbarFont",
- "GetToolbarBkgnd",
- "SetToolbarBkgnd",
- "GetToolbarTextColor",
- "SetToolbarTextColor",
- NULL
- };
-
- const char *CWLTestApp::m_pszHtmlAPIs[] = {
- "EnumParseTree",
- "GetChild",
- "GetParent",
- "GetSibling",
- "GetElementType",
- "GetElementText",
- "GetTextAttr",
- "GetTagName",
- "GetTagType",
- "GetTagAttr",
- "ExtractTagAttr",
- "FindText",
- "FindSpecial",
- "FindComment",
- "FindTagType",
- "FindTagName",
- "FindTagAttr",
- "EnumFindText",
- "EnumFindSpecial",
- "EnumFindComment",
- "EnumFindTagType",
- "EnumFindTagName",
- "EnumFindTagAttr",
- NULL
- };
-
- const char *CWLTestApp::m_pszUtilAPIs[] = {
- "AppendFormData",
- "GetFormDataLength",
- "ParseAbsoluteURL",
- NULL
- };
-
- /////////////////////////////////////////////////////////////////////////////
- // CWLTestApp message map and methods.
-
- BEGIN_MESSAGE_MAP(CWLTestApp, CWinApp)
- //{{AFX_MSG_MAP(CWLTestApp)
- ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- CWLTestApp::CWLTestApp()
- {
- }
-
- BOOL CWLTestApp::InitInstance()
- {
- SetDialogBkColor(); // set dialog background color to gray
- LoadStdProfileSettings(); // load standard INI file options (including MRU)
-
- if ((m_strMainWndClass = AfxRegisterWndClass(MAINWNDSTYLE,NULL,
- (HBRUSH) (COLOR_WINDOW + 1),NULL))[0] == '\0')
- return FALSE;
-
- m_pMainWnd = new CWLTestWnd;
- ASSERT(m_pMainWnd != NULL);
-
- m_pMainWnd->PostMessage(WM_APP_SHOWMAINDLG);
- return TRUE;
- }
-
- int CWLTestApp::ExitInstance()
- {
- m_pMainWnd->DestroyWindow();
- m_pMainWnd = NULL;
- return CWinApp::ExitInstance();
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CWLTestWnd -- main app window, invisible, needed so dialog works correctly
-
- BEGIN_MESSAGE_MAP(CWLTestWnd, CWnd)
- //{{AFX_MSG_MAP(CWLTestWnd)
- ON_MESSAGE(WM_APP_SHOWMAINDLG,OnShowMainDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- CWLTestWnd::CWLTestWnd() : CWnd()
- {
- (void) CreateEx(0,theApp.m_strMainWndClass,NULL,WS_OVERLAPPEDWINDOW,0,0,10,10,NULL,0);
- }
-
- LONG CWLTestWnd::OnShowMainDlg(UINT wParam,LONG lParam)
- {
- TRY
- {
- CMainDlg dlg;
- (void) dlg.DoModal();
- }
- CATCH(CMemoryException,e)
- {
- AfxMessageBox(IDS_ERR_OUTOFMEM);
- }
- END_CATCH
-
- ::PostQuitMessage(0);
- return 0;
- }
-
- void CWLTestWnd::PostNcDestroy()
- {
- ::MessageBeep(-1);
- delete this;
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CAboutDlg dialog used for App About
-
- class CAboutDlg : public CDialog
- {
- public:
- CAboutDlg();
-
- // Dialog Data
- //{{AFX_DATA(CAboutDlg)
- enum { IDD = IDD_ABOUTBOX };
- //}}AFX_DATA
-
- // Implementation
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //{{AFX_MSG(CAboutDlg)
- // No message handlers
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
-
- CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
- {
- //{{AFX_DATA_INIT(CAboutDlg)
- //}}AFX_DATA_INIT
- }
-
- void CAboutDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAboutDlg)
- //}}AFX_DATA_MAP
- }
-
- BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- //{{AFX_MSG_MAP(CAboutDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- // App command to run the dialog
- void CWLTestApp::OnAppAbout()
- {
- CAboutDlg aboutDlg;
- aboutDlg.DoModal();
- }
-
-