Click here to Skip to main content
15,902,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Winsock problem Pin
masnu7-Jul-10 4:24
masnu7-Jul-10 4:24 
GeneralRe: Winsock problem Pin
Iain Clarke, Warrior Programmer7-Jul-10 5:33
Iain Clarke, Warrior Programmer7-Jul-10 5:33 
AnswerRe: Winsock problem solved Pin
masnu7-Jul-10 8:20
masnu7-Jul-10 8:20 
GeneralRe: Winsock problem solved Pin
Moak7-Jul-10 8:22
Moak7-Jul-10 8:22 
GeneralRe: Winsock problem solved Pin
masnu7-Jul-10 8:25
masnu7-Jul-10 8:25 
GeneralRe: Winsock problem solved Pin
jeron17-Jul-10 10:18
jeron17-Jul-10 10:18 
GeneralRe: Winsock problem solved Pin
masnu7-Jul-10 10:22
masnu7-Jul-10 10:22 
GeneralRe: Winsock problem solved Pin
jeron17-Jul-10 10:41
jeron17-Jul-10 10:41 
GeneralRe: Winsock problem solved Pin
masnu7-Jul-10 10:46
masnu7-Jul-10 10:46 
GeneralRe: Winsock problem solved Pin
Moak7-Jul-10 11:15
Moak7-Jul-10 11:15 
GeneralRe: Winsock problem solved Pin
Moak7-Jul-10 11:56
Moak7-Jul-10 11:56 
GeneralRe: Winsock problem solved Pin
masnu8-Jul-10 2:59
masnu8-Jul-10 2:59 
QuestionDetect Windows Search feature Pin
Ivo Beltchev6-Jul-10 6:44
Ivo Beltchev6-Jul-10 6:44 
AnswerRe: Detect Windows Search feature Pin
«_Superman_»6-Jul-10 19:56
professional«_Superman_»6-Jul-10 19:56 
GeneralRe: Detect Windows Search feature Pin
Ivo Beltchev6-Jul-10 20:19
Ivo Beltchev6-Jul-10 20:19 
QuestionCListBox Pin
AbhiHcl6-Jul-10 3:04
AbhiHcl6-Jul-10 3:04 
AnswerRe: CListBox Pin
Niklas L6-Jul-10 3:21
Niklas L6-Jul-10 3:21 
GeneralRe: CListBox Pin
AbhiHcl6-Jul-10 19:50
AbhiHcl6-Jul-10 19:50 
AnswerRe: CListBox Pin
Niklas L6-Jul-10 21:52
Niklas L6-Jul-10 21:52 
No, but here is the rough idea.

1. Create a new class derived from CListBox -> CHoverListBox.
2. Make it owner drawn (a window style).
3. Override DrawItem() and possibly OnMeasureItem(). You will need DrawItem since you will be changing the visual appearance of the control while hovering.
4. Add a message handler for WM_MOUSEMOVE, and in this handler figure out which item the cursor is over. Cooridnates of the mouse is supplied in screen coords, so you should convert them to client coords using CListBox::ScreenToClient(). Then use CListBox::GetItemRect() to find the hovered item. Set a flag for this item, and then call Invalidate(FALSE) to force a repaint.
5. Implement DrawItem() to look at the flag set, and paint the items accordingly.
6. Now you have a reusable class.
7. Write an article about what you did and post it on this site.

Tip: Do not use CListBox::SetItemData() to set the flag, because the space is likely to be needed by the users of your control. Use a separate integer in your class instead.

QuestionPassing a String as function Argument Pin
T.RATHA KRISHNAN6-Jul-10 3:03
T.RATHA KRISHNAN6-Jul-10 3:03 
AnswerRe: Passing a String as function Argument Pin
Niklas L6-Jul-10 3:31
Niklas L6-Jul-10 3:31 
GeneralRe: Passing a String as function Argument Pin
T.RATHA KRISHNAN6-Jul-10 3:39
T.RATHA KRISHNAN6-Jul-10 3:39 
GeneralRe: Passing a String as function Argument Pin
Cedric Moonen6-Jul-10 3:47
Cedric Moonen6-Jul-10 3:47 
GeneralRe: Passing a String as function Argument Pin
T.RATHA KRISHNAN6-Jul-10 3:54
T.RATHA KRISHNAN6-Jul-10 3:54 
GeneralRe: Passing a String as function Argument Pin
Cedric Moonen6-Jul-10 4:14
Cedric Moonen6-Jul-10 4:14 

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.