54:
Can I display an icon file as picture and icon as well

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHTMLPicture(L"icon",((ObjectPtr)(spHTML1->ExecuteTemplate(_bstr_t("loadpicture(`gAAAABgYACAQgUCEAANAEgQWhIohMIhUJgkLhIAIEOjMdj0Cf8hAMhf8jkUkk0llEJGMJGcumECl8ymIAmc2lkonUnnkqkS3Qosea2QIkf61P4go5/") +
"D9LptIp9MpdKolGoFCnc+rUpri2QQlklhsVjsllqr/lk1m9rly1QAisTqbq6f7qbi4f7obKzf7na6xf7mayvwLWV1iqD/q9DotTp2PWh+Dz/WZ7DT/WB3CWYO2bXaKGV" +
"1u99v+FwjlaqssWRydnsuv2FiWB2CD/fj7ej/fL0dL/fDyc2+eTl1eSx9hwWHwWEczXWGB52mwuHsKuOgO3z1c7/ejubj/ebsbPgdjY4uT1li1Gq5fS9vt9di63Yezwb" +
"z/eLoaL/eDmZr+HO/6wvS9Kwt+4jfuCfB5u3BcGuA4TiOq678HUaZ/nueJyNikJaD+9DjLC8LxxG8htPJEjxPI80Juwd5yGOsRnlWNp/lYOACsQt5/wKkj8me/B0GhIM" +
"hngc8gP6/8jQEkj5n+dZvF4sUbxysJ2G4YjFEGE5Wx6kJ2nHGMwGQf8wRi+pww4zgIzVK8srcERTpRL0nm7KR1m6Xsnm4XcZRpG0cLEWY+g4o5ABCx04S1LisgCxKwnO" +
"bDAUjSborDKixSuYZ/q8ExS0bUCegC101NhN1DTjUKt1UAJckOFp3rOxMCONDynx2W8tmrVleVEkC0AAkNf2HYNgWFYtiWPZVjWZZNmICA`)"))));
spHTML1->Images(_bstr_t("gBJJgBggAAwAAgACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjIgjIBAEijUlk8plUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9oEEwGBwWDwMZGMZGeIxUYxOMxYAxuQw1+ykswmXzCuPwpea2QIkf61P4g0J/D+l0+i" +
"1Om0ukz2gzWcyuzk+Y22CWyCEsT3m932/h+vf+04kaw+O5GS5IzWqAEW8dTdXT/dTcXD/dDZWb/c7XWL/czWV/gayu3mq4fF2exzuf1uo+C0Pwef6zPYaf6wO4S/J2/h" +
"dkUGTqOs7jvPI8ZymqVjePk+j1Nm4TgQlCaHFgOwIH+fh9nof58nodJ/nweRzRCeRywY+b0wevz0Im8LzPC8ZzGuWDwRpA7yPMiZXDoB0Qnqc5/nodxuH+eZ2GzIx2Gx" +
"FEHRWv0Gt5BMFxjHEqyrKbeR5Hx7Hgbx/nidBon+eBzGbMhzzOicoyfKEUonEUTxFEh8HnIM6zvEcSxPHcezAdRpn+e54nJCh/loP8nTavcoonI8k0fJRtSVSEkSVJk+" +
"x8d5yGO3hnlWNp/lYOACvO50VUWvNGofMJnzAdBoVfWJ4HPV0yzPWk1IfLZ/nWbxeN5UdSomdhuGIf4+CwDRW1TRk3oedpx07aJkH/aNOy6cNDQsCNDWLY47CmCxTsLZ" +
"tVWehx1m7YF1F7XpuF3T1QVFUjeFmPoONCQAQve5rn2TZbL3MvMWoec5sO/g+ExuidhN5Yphn+OoqAwUrb4ukmBrvCNDQlb5/3DceMZHjONLqVo/BUd7hPRKOXNZfx/k" +
"wNoQGrkmb5Lky5oqHyVZ6jqPpCkYAZyjGipoh+daUo6Ag");
spHTML1->PutText(L"As Picture: <img>icon</img><br>As Icon:     <img>1</img>");

53:
How do I show a gradient text

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"first line<br>second line<br>third line");
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,1));
spHTML1->PutSelLength(11);
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatFont,"Tahoma");
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatFontSize,long(32));
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatGradient,long(255));
spHTML1->PutSelLength(0);

52:
How can I programmatically change the font

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"first line<br>second line<br>third line");
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,1));
spHTML1->PutSelLength(11);
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatFont,"Tahoma");
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatFontSize,long(32));
spHTML1->PutSelLength(0);

51:
How can I programmatically change the selection's foreground color
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"first line<br>second line<br>third line");
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,1));
spHTML1->PutSelLength(11);
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatForeColor,long(255));
spHTML1->PutSelLength(4);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatForeColor,"");
OutputDebugStringW( _bstr_t(spHTML1->GetFormatSelection(EXHTMLLib::exHTMLFormatForeColor)) );
spHTML1->PutSelLength(0);

50:
How can I programmatically resizes a picture
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spHTML1->PutText(L"first line<br>second line<br>third line");
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,1));
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatImage,"pic1");
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatImageSize,long(64));
spHTML1->PutSelLength(0);

49:
How can I programmatically inserts an icon/picture

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spHTML1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
spHTML1->PutText(L"first line<br>second line<br>third line");
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,1));
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatImage,long(1));
spHTML1->PutSelStart(spHTML1->GetXYToPosition(1,1));
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatImage,"pic1");
spHTML1->PutSelLength(0);

48:
How can I programmatically inserts a line

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"first line<br>second line<br>third line");
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,1));
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatLine,long(1));

47:
How can I programmatically format the selection

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"first line<br>second line<br>third line");
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,1));
spHTML1->PutSelLength(11);
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatBold,VARIANT_TRUE);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatAlign,long(1));
OutputDebugStringW( _bstr_t(spHTML1->GetFormatSelection(EXHTMLLib::exHTMLFormatBold)) );
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,2));
spHTML1->PutSelLength(-1);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatUnderline,VARIANT_TRUE);
spHTML1->PutFormatSelection(EXHTMLLib::exHTMLFormatAlign,long(2));

46:
How can I select the text giving (column,line)-coordinates
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This sample shows how to select the text giving (column,line)-coordinates.<br>This is the second line");
spHTML1->PutSelStart(spHTML1->GetXYToPosition(0,1));
spHTML1->PutSelLength(4);
spHTML1->PutHideSelection(VARIANT_FALSE);

45:
How can I determine the (column,line)-coordinates of the cursor's position
// SelChange event - Occurs when the user selects text in the control.
void OnSelChangeHTML1()
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'
		#import <ExHTML.dll>
		using namespace EXHTMLLib;
	*/
	EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
	OutputDebugStringW( L"Column" );
	OutputDebugStringW( _bstr_t(spHTML1->GetPositionToX(spHTML1->GetCursorPos())) );
	OutputDebugStringW( L"Line" );
	OutputDebugStringW( _bstr_t(spHTML1->GetPositionToY(spHTML1->GetCursorPos())) );
}

EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(L"This sample shows how to determine the <b>(column,line)</b> - coordinates.");

44:
How can I provide my own context menu

// ExecuteContextMenu event - Occurs when the user selects an user item from the control's context menu.
void OnExecuteContextMenuHTML1(LPCTSTR Item,long Position)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'
		#import <ExHTML.dll>
		using namespace EXHTMLLib;
	*/
	EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
	OutputDebugStringW( L"You selected: " );
	OutputDebugStringW( L"Item" );
	spHTML1->PutSelText(L"Item");
}

EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text. Right-click the text.");
spHTML1->PutContextMenuItems(L"1,2,3,others[id=0](4,5,6) ");

43:
How can I change the context menu's visual appearance

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(L"This sample show change the visual appearance of the built-in context menu");
spHTML1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spHTML1->PutBackground(EXHTMLLib::exContextMenuAppearance,0x1000000);
spHTML1->PutBackground(EXHTMLLib::exContextMenuSelBackColor,0x10000ff);

42:
How can I insert my own HTML words to the control's context menu

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(_bstr_t(" <off 5><font ;7><fgcolor 808080>sub-note</fgcolor></font></off> This is just a bit of text <off -5><font ;7><fgcolor 808080>su") +
"per-note</fgcolor></font></off> ");
spHTML1->PutContextMenuItems(_bstr_t("<off 5><font ;7><fgcolor 808080>sub-note</fgcolor></font></off>[id=57763],<off -5><font ;7><fgcolor 808080>super-note</fgcolor>") +
"</font></off>[id=57763]");

41:
When I use the context menu to insert an image, the size seems to be fixed to 32 pixels. How can I control / change this

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spHTML1->PutHTMLPicture(L"pic2","c:\\exontrol\\images\\auction.gif");
spHTML1->PutHTMLPicture(L"pic3","c:\\exontrol\\images\\colorize.gif");
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(_bstr_t("The text displays pictures <img>pic1:32</img>,..., <img>pic2:32</img>.<br><b>1.</b> Select a single picture, right click to res") +
"ize it<br><b>2.</b> Right click to insert a new picture");
spHTML1->PutContextMenuItems(_bstr_t("Size[id=57680][edittype=515][border=0][min=16][max=128][freq=16][editwidth=-128][ticklabel=value = %i ? '<b>'+value : ( value =") +
" vmax ? '<fgcolor 808080><font ;6><b>'+value : ( value = vmin ? '<fgcolor 808080><font ;6><b>'+value : '' ) )],Insert[group=3](<" +
"img>pic1:32</img>[id=57763],<img>pic2:32</img>[id=57763],Others[id=1000](default[group=3](<img>pic3</img>[id=57763]),<font ;6>ot" +
"her sizes[sep],<img>pic3:16</img>[id=57763],<img>pic3:32</img>[id=57763],<img>pic3:64</img>[id=57763]))");

40:
How can I programatically selects the entire text

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(_bstr_t("<b>Job</b><br>/jäb/<br><br><i>noun</i><br><b>1.</b> a paid position of regular employment.<br><b>2.</b> a task or piece of work") +
", especially one that is paid.");
spHTML1->PutSelStart(0);
spHTML1->PutSelLength(-1);

39:
How can I search for an exacting word

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(_bstr_t("<b>Class</b><br>/klas/<br><br><i>noun</i><br><b>1.</b> a set or category of things having some property or attribute in common ") +
"and differentiated from others by kind, type, or quality.<br><br><b>2.</b> the system of ordering a society in which people are " +
"divided into sets based on perceived social or economic status.");
spHTML1->Find(L"differentiated",EXHTMLLib::exHTMLEditMatchWholeWordOnly);

38:
How can I search for a string

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(_bstr_t("<b>Class</b><br>/klas/<br><br><i>noun</i><br><b>1.</b> a set or category of things having some property or attribute in common ") +
"and differentiated from others by kind, type, or quality.<br><br><b>2.</b> the system of ordering a society in which people are " +
"divided into sets based on perceived social or economic status.");
spHTML1->Find(L"different",EXHTMLLib::exHTMLEditSearchDown);

37:
I am using the ScrollBars property on 0, but the control is not scrolling anymore. What can be done

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutSingleLine(VARIANT_TRUE);
spHTML1->PutText(L"This is a <b>long text</b> that should make the control to display the horizontal scroll bar.");
spHTML1->PutScrollBars(EXHTMLLib::exBoth);
spHTML1->PutScrollWidth(0);
spHTML1->PutScrollHeight(0);

36:
How can I force the control to display a single-line only

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutSingleLine(VARIANT_TRUE);
spHTML1->PutText(L"This is the first line<br>This is the second line");

35:
How can I replace the text with HTML formatting

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(L"This is a bit of text");
spHTML1->PutCursorText(10,3,VARIANT_FALSE,L"<dotline><gra FFFFFF;0;1><font ;12>... this is a HTML replacement ...</font></gra></dotline>");

34:
How can I insert HTML text (method 2)

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a simple text.");
spHTML1->PutCursorText(0,0,VARIANT_FALSE,L"<b><dotline>Inserted by code</dotline></b>. ");

33:
How can I insert HTML text (method 1)

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a simple text.");
spHTML1->PutSelStart(0);
spHTML1->PutSelLength(0);
spHTML1->PutSelText(L"<b><dotline>Inserted by code</dotline></b>. ");

32:
How can I add/append HTML text (method 2)

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a simple text.");
spHTML1->PutCursorText(-1,0,VARIANT_FALSE,L" <b><dotline>Added by code</dotline></b>.");

31:
How can I add/append HTML text (method 1)

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a simple text.");
spHTML1->PutSelStart(-1);
spHTML1->PutSelLength(0);
spHTML1->PutSelText(L" <b><dotline>Added by code</dotline></b>.");

30:
How can I replace the text with no HTML formatting

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(L"<font ;12>This is a <fgcolor FF0000> bit </fgcolor> of <b><fgcolor 808080><u>HTML</u></fgcolor></b> text");
spHTML1->PutCursorText(11,3,vtMissing,L"... this is a plain replacement ...");

29:
Is there any property or method that gets the entire text with no HTML formatting

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(L"<font ;12><sha  ;;0>This is a bit of <b><fgcolor 808080><u>HTML</u></fgcolor></b> text.");
OutputDebugStringW( spHTML1->GetCursorText(0,-1,VARIANT_TRUE) );

28:
How can I get the selection as plain text with no HTML formatting

// SelChange event - Occurs when the user selects text in the control.
void OnSelChangeHTML1()
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'
		#import <ExHTML.dll>
		using namespace EXHTMLLib;
	*/
	EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
	OutputDebugStringW( spHTML1->GetCursorText(spHTML1->GetSelStart(),spHTML1->GetSelLength(),VARIANT_TRUE) );
}

EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(_bstr_t("<font ;12><sha  ;;0>This is a bit of <b><fgcolor 808080><u>HTML</u></fgcolor></b> text. Select a portion of text and you will g") +
"et the text with no HTML formatting.");

27:
How can I customize the pictures in the control's context menu

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spHTML1->PutHTMLPicture(L"pic2","c:\\exontrol\\images\\auction.gif");
spHTML1->PutHTMLPicture(L"pic3","c:\\exontrol\\images\\colorize.gif");
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutText(_bstr_t("The text displays pictures <img>pic1:32</img>,..., <img>pic2:32</img>.<br><b>1.</b> Select a single picture, right click to res") +
"ize it<br><b>2.</b> Right click to insert a new picture");
spHTML1->PutContextMenuItems(_bstr_t("Size[id=57680][edittype=515][border=0][min=16][max=128][freq=16][editwidth=-128][ticklabel=value = %i ? '<b>'+value : ( value =") +
" vmax ? '<fgcolor 808080><font ;6><b>'+value : ( value = vmin ? '<fgcolor 808080><font ;6><b>'+value : '' ) )],Insert[group=3](<" +
"img>pic1:32</img>[id=57763],<img>pic2:32</img>[id=57763],Others[id=1000](<img>pic3:32</img>[id=57763]))");

26:
How do I show a tooltip

// MouseMove event - Occurs when the user moves the mouse.
void OnMouseMoveHTML1(short Button,short Shift,long X,long Y)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'
		#import <ExHTML.dll>
		using namespace EXHTMLLib;
	*/
	EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
	spHTML1->ShowToolTip(L"Just a short tooltip",vtMissing,vtMissing,vtMissing,vtMissing);
}

EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spHTML1->PutBackground(EXHTMLLib::exToolTipAppearance,0x1000000);

25:
Is it possible to assign a tooltip for items in the control's context menu

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text. Select and right-click the selection.");
spHTML1->PutContextMenuItems(L"<font ;18><b>B[id=57648][typ=1][align=1][show=1][ttp=Bolds/Unbolds the selection]");

24:
How do I get the selected text

// SelChange event - Occurs when the user selects text in the control.
void OnSelChangeHTML1()
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'
		#import <ExHTML.dll>
		using namespace EXHTMLLib;
	*/
	EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
	OutputDebugStringW( spHTML1->GetSelText() );
}

EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"Press the <b>CTRL + S</b> or <b>CTRL + F</b> to search for text.");

23:
Is there any way to search through the text

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"Press the <b>CTRL + S</b> or <b>CTRL + F</b> to search for text.");
spHTML1->PutAllowFind(VARIANT_TRUE);
spHTML1->PutAllowIncrementalSearch(VARIANT_TRUE);

22:
The selection is not shown when the control loses the focus. Is it possible to highlight the selection while the control has no focus

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"<font ;12>This is a bit of <b>HTML</b> text.");
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutSelStart(0);
spHTML1->PutSelLength(-1);
spHTML1->PutSelBackColorHide(RGB(255,0,0));

21:
Does your control support Find/Replace

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutAllowFind(VARIANT_TRUE);
spHTML1->PutAllowReplace(VARIANT_TRUE);

20:
How can I get the current selection

// SelChange event - Occurs when the user selects text in the control.
void OnSelChangeHTML1()
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'
		#import <ExHTML.dll>
		using namespace EXHTMLLib;
	*/
	EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
	OutputDebugStringW( spHTML1->GetSelText() );
}

EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");

19:
I've noticed that the text does not start exactly where the control is. How can I adjust/remove that margin

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutBorderWidth(0);
spHTML1->PutBorderHeight(0);

18:
How can I center the text

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"<c>This is a bit of centered <b>HTML</b> text.");

17:
How can I align the text to the right

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"<r>This is a bit of <b>HTML</b> text, aligned to the right.");

16:
How can I turn on the control's OLE Drag and Drop operation
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutOLEDropMode(EXHTMLLib::exOLEDropAutomatic);

15:
Does your control support word-wrap, and if so how can I enable it

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(_bstr_t("This is a bit of <b>HTML</b> text. This is a bit of <b>HTML</b> text. This is a bit of <b>HTML</b> text. This is a bit of <b>HT") +
"ML</b> text. This is a bit of <b>HTML</b> text.");
spHTML1->PutWordWrap(VARIANT_TRUE);
spHTML1->PutLineNumberWidth(-1);
spHTML1->PutDrawGridLines(VARIANT_TRUE);

14:
Can I edit text with no formatting at all

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutEditType(EXHTMLLib::exPlainText);

13:
I've noticed that pressing the CTRL+B changes the Bold attribute. Can I change that behavior
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutAllowShortcutFormat(VARIANT_FALSE);

12:
How do I prevents shown the control's content menu

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutAllowContextMenu(EXHTMLLib::exHideContextMenu);

11:
How do I make the control read-only

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutBackColorLocked(spHTML1->GetBackColor());
spHTML1->PutForeColorLocked(spHTML1->GetForeColor());
spHTML1->PutLocked(VARIANT_TRUE);
spHTML1->PutShowCaret(VARIANT_FALSE);

10:
Can I replace programatically a portion of text

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutSelStart(0);
spHTML1->PutSelLength(1);
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutSelText(L"<fgcolor FF><font ;18>T</font></fgcolor>");

9:
How do I select the entire text programatically

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutSelStart(0);
spHTML1->PutSelLength(-1);
spHTML1->PutHideSelection(VARIANT_FALSE);

8:
How do I programatically add text to the control

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutSelStart(-1);
spHTML1->PutSelText(L" <fgcolor FF0000><b>Inserted Text</b></fgcolor>");

7:
How do I programatically insert text to the control

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");
spHTML1->PutSelText(L"<fgcolor FF0000><b>Inserted Text</b></fgcolor> ");

6:
How do I get the unformatted text

// SelChange event - Occurs when the user selects text in the control.
void OnSelChangeHTML1()
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'
		#import <ExHTML.dll>
		using namespace EXHTMLLib;
	*/
	EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
	OutputDebugStringW( spHTML1->GetCursorText(spHTML1->GetSelStart(),spHTML1->GetSelLength(),vtMissing) );
}

EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");

5:
How do I provide my own menu for my images (emotion icons)

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"<img>1</img> Right click the image <img>pic1</img> to get resized.");
spHTML1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
spHTML1->PutContextMenuItems(L"Insert[group=3](<img>1</img>[id=57763],<img>2</img>[id=57763])");

4:
How do I display images inside text

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spHTML1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
spHTML1->PutText(L"<img>1</img> Right click the image <img>pic1</img> to get resized.");

3:
How do I allow types only to be available on the control's context menu

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"Right click the selection.");
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutSelStart(16);
spHTML1->PutSelLength(9);
spHTML1->PutAllowContextMenu(EXHTMLLib::HTMLEditContextMenuEnum(EXHTMLLib::exContextMenuFormatStrikeout | EXHTMLLib::exContextMenuFormatUnderline | EXHTMLLib::exContextMenuFormatItalic | EXHTMLLib::exContextMenuFormatBold));

2:
How do I programatically select the text

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"<font ;12>This is a bit of <b>HTML</b> text.");
spHTML1->PutHideSelection(VARIANT_FALSE);
spHTML1->PutSelStart(0);
spHTML1->PutSelLength(-1);

1:
How do I assign a text to the control

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXHTMLLib' for the library: 'ExHTML 1.0 Control Library'

	#import <ExHTML.dll>
	using namespace EXHTMLLib;
*/
EXHTMLLib::IHTMLPtr spHTML1 = GetDlgItem(IDC_HTML1)->GetControlUnknown();
spHTML1->PutText(L"This is a bit of <b>HTML</b> text.");