Click here to Skip to main content
15,905,612 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: corruption of comctl32 Pin
JWood25-Sep-03 11:10
JWood25-Sep-03 11:10 
GeneralWTL in VC 7.0 COM Project Pin
Rama Krishna Vavilala25-Sep-03 6:03
Rama Krishna Vavilala25-Sep-03 6:03 
GeneralRe: WTL in VC 7.0 COM Project Pin
LunaticFringe25-Sep-03 6:13
LunaticFringe25-Sep-03 6:13 
GeneralCan't receive data under win98 with MSComm Pin
caykahve25-Sep-03 5:50
caykahve25-Sep-03 5:50 
Generalhyperlink in text box Pin
si_6925-Sep-03 5:31
si_6925-Sep-03 5:31 
GeneralRe: hyperlink in text box Pin
David Crow25-Sep-03 5:34
David Crow25-Sep-03 5:34 
GeneralRe: hyperlink in text box Pin
ashxly25-Sep-03 5:51
ashxly25-Sep-03 5:51 
GeneralRe: hyperlink in text box Pin
RobJones25-Sep-03 5:53
RobJones25-Sep-03 5:53 
As David posted earlier, you could do this with a RichEdit control.. Here's how I have done it in the past.. the example is using a RichEdit control in a dialog box..

// Inside the Init of the dialog..
unsigned mask = m_cRichEdit.GetEventMask();
m_cRichEdit.SetEventMask(mask | ENM_LINK);
m_cRichEdit.SendMessage(EM_AUTOURLDETECT,TRUE,0);
 
// Inside WindowProc of the dialog..
if(message == WM_NOTIFY) 
{
	// ENABLE URL LINKS IN OUR RICH EDIT CONTROL.
	if(((LPNMHDR)lParam)->code == EN_LINK)
	{			
		ENLINK* p = (ENLINK *)lParam;
		if (p->msg == WM_LBUTTONDOWN)
		{
			ENLINK* p = (ENLINK *)lParam;
			m_cRichEdit.SendMessage(EM_EXSETSEL, 0, (LPARAM)&(p->chrg));
			m_cRichEdit.SetSel(p->chrg);
			CString strLink = m_cRichEdit.GetSelText();
			ShellExecute(NULL, "open", strLink, NULL, NULL, SW_SHOWNORMAL);
		}
	}
}

Don't forget to do a AfxInitRichEdit(); inside the Init of the APP..

Hope this helps,
Rob

Whoever said nothing's impossible never tried slamming a revolving door!
GeneralInitialising Collection Classes Pin
MerlinB25-Sep-03 5:25
MerlinB25-Sep-03 5:25 
GeneralRe: Initialising Collection Classes Pin
valikac25-Sep-03 6:16
valikac25-Sep-03 6:16 
GeneralC++ to Matlab conversion Pin
73Zeppelin25-Sep-03 5:17
73Zeppelin25-Sep-03 5:17 
GeneralRe: C++ to Matlab conversion Pin
RobJones25-Sep-03 5:28
RobJones25-Sep-03 5:28 
GeneralRe: C++ to Matlab conversion Pin
73Zeppelin25-Sep-03 5:33
73Zeppelin25-Sep-03 5:33 
GeneralRe: C++ to Matlab conversion Pin
JWood25-Sep-03 11:19
JWood25-Sep-03 11:19 
GeneralUPX compression Pin
Mila02525-Sep-03 5:12
Mila02525-Sep-03 5:12 
GeneralIOStreams Pin
KKR25-Sep-03 4:49
KKR25-Sep-03 4:49 
GeneralWinsock Layered Service Provider question Pin
Kuniva25-Sep-03 4:26
Kuniva25-Sep-03 4:26 
Generalddif to tif Pin
jredfern25-Sep-03 4:01
jredfern25-Sep-03 4:01 
GeneralInternationalization Issues Pin
Eco Jones25-Sep-03 3:36
Eco Jones25-Sep-03 3:36 
GeneralDiscovered the problem Pin
Eco Jones25-Sep-03 4:28
Eco Jones25-Sep-03 4:28 
GeneralRight-to-Left Reading Order MFC based Application Pin
ZAkinG25-Sep-03 3:18
ZAkinG25-Sep-03 3:18 
GeneralRe: Right-to-Left Reading Order MFC based Application Pin
David Crow25-Sep-03 5:33
David Crow25-Sep-03 5:33 
GeneralRe: Right-to-Left Reading Order MFC based Application Pin
ZAkinG25-Sep-03 10:53
ZAkinG25-Sep-03 10:53 
GeneralRe: Right-to-Left Reading Order MFC based Application Pin
David Crow26-Sep-03 3:12
David Crow26-Sep-03 3:12 
GeneralHELP PLEASE!!!! CANT FIGURE THIS OUT... Pin
Anonymous25-Sep-03 2:54
Anonymous25-Sep-03 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.