Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
Hi,
I have dll that coded by win32 and using resource.
I am using Listbox control in this dll.
 
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 19-Nov-12 21:39pm
Rezame951
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 28-Nov-12 19:51pm
   
Right, good points, a 5.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Comments
Espen Harlinn at 20-Nov-12 10:10am
   
5'ed!
Sergey Alexandrovich Kryukov at 28-Nov-12 19:51pm
   
Agree, a 5.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  
Comments
Richard MacCutchan at 20-Nov-12 10:16am
   
And a 5 for you; I forgot about this control.
Espen Harlinn at 20-Nov-12 10:17am
   
Thank you, Richard :-D
Sergey Alexandrovich Kryukov at 28-Nov-12 19:51pm
   
Good one, a 5.
--SA
Espen Harlinn at 29-Nov-12 3:44am
   
Thank you, Sergey :-D
Mika Wendelius at 12-Dec-12 0:19am
   
Good control to remember :)
Espen Harlinn at 12-Dec-12 9:37am
   
Thank you, Mika :-D

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

  Print Answers RSS
0 Maciej Los 205
1 Richard MacCutchan 185
2 DamithSL 170
3 Tomas Takac 146
4 OriginalGriff 132
0 OriginalGriff 5,130
1 DamithSL 4,237
2 Maciej Los 3,700
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,846


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100