Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I have dll that coded by win32 and using resource.
I am using Listbox control in this dll.

C++
case IDC_LIST1:
int index = SendDlgItemMessage(hDlg, IDC_LIST1, LB_ADDSTRING, (LPARAM)"RR", (LPARAM)"www.rezafx.com");
break;

I add content to listbox with above lines.
I want show one string include hyperlink in my List box. How I must do that?
With above code it only show static text.
Regards,
Posted

If working with win32 (no MFC) take a look at this to change color of items in the list:

Using ListView control under Win32 API[^]

This part of the article says it all:
"You won't believe how much time I took to dig this up to actually work! I mean, 99.99% examples were MFC only!
So here we go, finally, pure WinAPI code for listview colors."

If you can use MFC, this this article shows an hyperlink:

CGridListCtrlEx - Grid Control Based on CListCtrl[^]

Hope it helps.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Nov-12 19:51pm    
Right, good points, a 5.
--SA
The ListBox control does not understand hyperlinks, only strings. However, you can use the LBS_OWNERDRAWFIXED style, as described in this MSDN page[^], and provide your own message handling to add such functionality.
 
Share this answer
 
Comments
Espen Harlinn 20-Nov-12 10:10am    
5'ed!
Sergey Alexandrovich Kryukov 28-Nov-12 19:51pm    
Agree, a 5.
--SA
Have a look at Create your own controls - the art of subclassing[^]

You can subclass the listbox, and keep track of when your item should be visible. Create a SysLink[^] control and place it over your item.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Richard MacCutchan 20-Nov-12 10:16am    
And a 5 for you; I forgot about this control.
Espen Harlinn 20-Nov-12 10:17am    
Thank you, Richard :-D
Sergey Alexandrovich Kryukov 28-Nov-12 19:51pm    
Good one, a 5.
--SA
Espen Harlinn 29-Nov-12 3:44am    
Thank you, Sergey :-D
Wendelius 12-Dec-12 0:19am    
Good control to remember :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900