Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Using RichEdit 2.0/3.0 and detecting URLs & email
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
A.Gil  
View profile  
 More options Nov 27 2003, 4:39 pm
Newsgroups: borland.public.cppbuilder.students
From: "A.Gil" <siloi...@hotmail.com>
Date: Thu, 27 Nov 2003 22:35:43 +0100
Local: Thurs, Nov 27 2003 4:35 pm
Subject: Using RichEdit 2.0/3.0 and detecting URLs & email
Hi.. I'm making some tests to detect URL typing(and email addresses) in
a richedit component in my application.
Looking at Google, and Robert Dunn
website(http://home.att.net/~robertdunn/Yacs.html), I know that the
TRichEdit componente in BCB uses RichEdit 1.0 and that i must use
version 2.0 or 3.0 to achieve this(and other new options in richedits:
zoom, etc...)

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);


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Remy Lebeau \(TeamB\)  
View profile  
 More options Nov 27 2003, 5:17 pm
Newsgroups: borland.public.cppbuilder.students
From: "Remy Lebeau \(TeamB\)" <gambit47.no.s...@no.spam.yahoo.com>
Date: Thu, 27 Nov 2003 14:19:05 -0800
Local: Thurs, Nov 27 2003 5:19 pm
Subject: Re: Using RichEdit 2.0/3.0 and detecting URLs & email
"A.Gil" <siloi...@hotmail.com> wrote in message

news:3fc66e34@newsgroups.borland.com...

> 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/ric...
    Or:
    http://tinyurl.com/wtph

Gambit


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
A.Gil  
View profile  
 More options Nov 27 2003, 5:32 pm
Newsgroups: borland.public.cppbuilder.students
From: "A.Gil" <siloi...@hotmail.com>
Date: Thu, 27 Nov 2003 23:25:05 +0100
Local: Thurs, Nov 27 2003 5:25 pm
Subject: Re: Using RichEdit 2.0/3.0 and detecting URLs & email

> Why not just use Robert's TaeRichEdit component?  It already does all the
> work for you.

I'll try it.

Thanks for your quick answer, Remy.
A.Gil


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google