Functions

mCtrl/html.h File Reference

HTML control (MC_WC_HTML). More...

Go to the source code of this file.

Defines

Window Class

#define MC_WC_HTMLW   L"mCtrl.html"
 Window class name (unicode variant).
#define MC_WC_HTMLA   "mCtrl.html"
 Window class name (ANSI variant).
#define MC_WC_HTML   MC_WC_HTMLW
 Unicode-resolution alias.
Control Messages

#define MC_HM_GOTOURLW   (WM_USER + 10)
#define MC_HM_GOTOURLA   (WM_USER + 11)
#define MC_HM_GOTOURL   MC_HM_GOTOURLW
 Unicode-resolution alias.

Functions

BOOL MCTRL_API mcHtml_Initialize (void)
 Registers window class of the HTML control.
void MCTRL_API mcHtml_Terminate (void)
 Unregisters window class of the HTML control.

Detailed Description

HTML control (MC_WC_HTML).

As the control name suggests, the control displays a HTML documents. In fact the control embeds Internet Explorer in it, so it can display much more, inclusing images, directory contents, Microsoft help files etc.

Currently there is only one message, MC_HM_GOTOURL which controls what page is displayed in the control. That's all. ;-)

Examples of URLs accepted by the MC_HM_GOTOURL message:

In future the control should be extended to support displaying of in memory HTML documents, documents stored in application resource files, and to send some notification messages when some interesting stuff happens (e.g. when user clicks on a link, or when the control finishes loading of the HTML page).

However it will never be intended to do everything, so do not plan developing of full-featured web browser on top of the control ;-)

The HTML control implementation is based on OLE and COM technologies. During creation of the control OleInitialize() is called. I.e. the OLE subsystem is inirialized for every thread which creates the HTML control. OleUninitialize() is similarly called when the control is destroyed.

Attention:
If you want to send some messages to the control from another thread then where it has been created, you have to initialize OLE subsystem in that thread manually.

Define Documentation

#define MC_HM_GOTOURLW   (WM_USER + 10)

Displays a contents specified by the given URL (unicode variant).

Parameters:
wParam Reserved, set to zero.
[in] lParam (const WCHAR*) Pointer to URL string.
Returns:
Zero on success, -1 on failure.
#define MC_HM_GOTOURLA   (WM_USER + 11)

Displays a contents specified by the given URL (ANSI variant).

Parameters:
wParam Reserved, set to zero.
[in] lParam (const char*) Pointer to URL string.
Returns:
Zero on success, -1 on failure.

Function Documentation

BOOL MCTRL_API mcHtml_Initialize ( void   ) 

Registers window class of the HTML control.

Returns:
TRUE on success, FALSE on failure.
See also:
About Initialization and Termination
void MCTRL_API mcHtml_Terminate ( void   ) 

Unregisters window class of the HTML control.

See also:
About Initialization and Termination