My code for loading the library is (in the form's constructor)
HINSTANCE hInst;
hInst = LoadLibrary("riched20.dll");
if(!hInst)
ShowMessage("not loaded");
Is this fine? (I've never loaded a DLL before, just a newbie)
I found an article in BCB Developer's Journal about detecting
URL'.(showed below).This works fine, but can be and also an email
address detected? Is possible? How could this be done?
Thank you very much.
(Sorry for my poor english)
A.Gil
The code in the example is:
(In the form's constructor)
unsigned mask = SendMessage(RichEdit1->Handle,
EM_GETEVENTMASK, 0, 0);
SendMessage(RichEdit1->Handle, EM_SETEVENTMASK,
0, mask | ENM_LINK);
SendMessage(RichEdit1->Handle, EM_AUTOURLDETECT,
true, 0);
RichEdit1->Text = "The Bridges Publishing Web"
" Site is located at www.bridgespublishing.com. Check"
" it out.";
--------------------------------------------
void __fastcall TForm1::WndProc(
Messages::TMessage &Message)
{
if (Message.Msg == WM_NOTIFY)
{
if (((LPNMHDR)Message.LParam)->code ==EN_LINK)
{
ENLINK* p = (ENLINK *)Message.LParam;
if (p->msg == WM_LBUTTONDOWN)
{
SendMessage(RichEdit1->Handle,
EM_EXSETSEL, 0, (LPARAM)&(p->chrg));
ShellExecute(Handle, "open",
RichEdit1->SelText.c_str(), 0, 0,
SW_SHOWNORMAL);
}
}
}
TForm::WndProc(Message);
}
> My code for loading the library is (in the form's constructor)
Why not just use Robert's TaeRichEdit component? It already does all the
work for you.
> Is this fine? (I've never loaded a DLL before, just a newbie)
That will load the DLL, but that is not enough to actually use the newer
controls. You still have to explitically instantiate the desired control
via CreateWindow() just like any other windowed control. You can't
magically make a standard TRichEdit use REv2 or REv3 instead of REv1 by just
loading the library alone.
> This works fine, but can be and also an email address detected?
EM_AUTOURLDETECT supports many different URL types, including email
addresses:
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols/richeditcontrolreference/richeditmessages/em_autourldetect.asp
Or:
http://tinyurl.com/wtph
Gambit
I'll try it.
Thanks for your quick answer, Remy.
A.Gil