CorpSms/HtmlCtrl.h
2025-02-27 16:58:16 +08:00

62 lines
2.0 KiB
C++

////////////////////////////////////////////////////////////////
// If this code works, it was written by Paul DiLascia.
// If not, I don't know who wrote it.
// Compiles with Visual C++ 6.0, runs on Windows 98 and probably NT too.
//
class CHtmlCtrl : public CHtmlView {
public:
CHtmlCtrl() { }
~CHtmlCtrl() { }
BOOL CreateFromStatic(UINT nID, CWnd* pParent);
// Normally, CHtmlView destroys itself in PostNcDestroy,
// but we don't want to do that for a control since a control
// is usually implemented as a stack object in a dialog.
//
virtual void PostNcDestroy() { }
// overrides to bypass MFC doc/view frame dependencies
afx_msg void OnDestroy();
afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT msg);
// override to trap "app:" pseudo protocol
virtual void OnBeforeNavigate2( LPCTSTR lpszURL,
DWORD nFlags,
LPCTSTR lpszTargetFrameName,
CByteArray& baPostedData,
LPCTSTR lpszHeaders,
BOOL* pbCancel );
CString GetFullName() const;
CString GetType() const;
CString GetLocationName() const;
CString GetLocationURL() const;
void Navigate(LPCTSTR lpszURL, DWORD dwFlags = 0 ,
LPCTSTR lpszTargetFrameName = NULL ,
LPCTSTR lpszHeaders = NULL, LPVOID lpvPostData = NULL,
DWORD dwPostDataLen = 0);
//Add the following functions. This action prevents the leak because the
//CHtmlView versions of LoadFromResource() call CHtmlView::Navigate().
//These need to be defined because CHtmlView::Navigate() is not virtual.
BOOL LoadFromResource(LPCTSTR lpszResource);
BOOL LoadFromResource(UINT nRes);
//end new code
// override to handle links to "app:mumble...". lpszWhere will be "mumble"
virtual void OnAppCmd(LPCTSTR lpszWhere);
//virtual void OnDocumentComplete(LPCTSTR lpszURL);
virtual void OnDocumentComplete(LPCTSTR lpszURL);
virtual void OnNavigateComplete2(LPCTSTR strURL);
virtual BOOL PreTranslateMessage(MSG* pMsg);
DECLARE_MESSAGE_MAP();
DECLARE_DYNAMIC(CHtmlCtrl)
};