Click here to Skip to main content
15,912,837 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Source code ... Pin
Hadi Rezaee27-May-01 4:04
Hadi Rezaee27-May-01 4:04 
GeneralRe: Source code ... Pin
Christian Graus27-May-01 12:00
protectorChristian Graus27-May-01 12:00 
GeneralRe: Source code ... Pin
Hadi Rezaee27-May-01 17:47
Hadi Rezaee27-May-01 17:47 
GeneralRe: Source code ... Pin
Christian Graus27-May-01 18:34
protectorChristian Graus27-May-01 18:34 
QuestionWhich media API to use? Pin
Jonathan Gilligan25-May-01 11:44
Jonathan Gilligan25-May-01 11:44 
AnswerRe: Which media API to use? Pin
l a u r e n26-May-01 0:14
l a u r e n26-May-01 0:14 
GeneralWTL Question Pin
25-May-01 10:43
suss25-May-01 10:43 
GeneralRe: WTL Question Pin
Ben Burnett26-May-01 17:35
Ben Burnett26-May-01 17:35 
Hey,

I'll assume you tring to handle all the message you mentioned in your list-view control.

First to get the NM_CLICK notification to work (as well as any other notification) you need to reflect the notifications back from the mainframe (this is a standard procedure, thought MFC does a nice job of hidding it from us). To do this use the REFLECT_NOTIFICATIONS () macro in you mainframe's message map (or what ever window is the list-view's parent). Also, when you handle the message use REFLECTED_NOTIFY_CODE_HANDLER in you list-view message map.

Second the reason I think your getting a wrong result from GetSelectedIndex () in your WM_LBUTTONDOWN message handler is because you are probably not letting Windows do its default processing (selecting the item), simply make call to DefWindowProc () before you try and get the selected item's index -- also note that this function only works with single selection list-views.

> Also what should I cast the lparam to in the message handler?

no need to cast, just use:

CPoint point ( GET_X_LPARAM ( lParam ), GET_Y_LPARAM ( lParam ) );

Hope this helps.

-Ben

"Its funny when you stop doing things not because they’re wrong, but because you might get caught." - Unknown
GeneralContext menus and tree/list control item Pin
Jim A. Johnson25-May-01 10:41
Jim A. Johnson25-May-01 10:41 
GeneralRe: Context menus and tree/list control item Pin
Michael Dunn25-May-01 12:57
sitebuilderMichael Dunn25-May-01 12:57 
GeneralRe: Context menus and tree/list control item Pin
Jim A. Johnson25-May-01 16:00
Jim A. Johnson25-May-01 16:00 
GeneralRe: Context menus and tree/list control item Pin
Michael Dunn25-May-01 16:11
sitebuilderMichael Dunn25-May-01 16:11 
GeneralMemory Crunching Pin
2sky25-May-01 10:31
2sky25-May-01 10:31 
GeneralRe: Memory Crunching Pin
Rick York25-May-01 11:56
mveRick York25-May-01 11:56 
GeneralRe: Memory Crunching Pin
Tomasz Sowinski25-May-01 13:00
Tomasz Sowinski25-May-01 13:00 
GeneralRe: Memory Crunching Pin
2sky25-May-01 22:10
2sky25-May-01 22:10 
GeneralTo open a document with its associated executor/viewer Pin
25-May-01 10:21
suss25-May-01 10:21 
GeneralRe: To open a document with its associated executor/viewer Pin
Tomasz Sowinski25-May-01 12:58
Tomasz Sowinski25-May-01 12:58 
GeneralRe: To open a document with its associated executor/viewer Pin
Michael Dunn25-May-01 12:59
sitebuilderMichael Dunn25-May-01 12:59 
GeneralWindows FileFind API's Pin
25-May-01 8:38
suss25-May-01 8:38 
GeneralRe: Windows FileFind API's Pin
Carlos Antollini25-May-01 9:14
Carlos Antollini25-May-01 9:14 
GeneralRe: Windows FileFind API's Pin
25-May-01 9:15
suss25-May-01 9:15 
GeneralRe: Windows FileFind API's Pin
Hadi Rezaee25-May-01 18:46
Hadi Rezaee25-May-01 18:46 
GeneralRe: Windows FileFind API's (More Questions) Pin
26-May-01 13:37
suss26-May-01 13:37 
GeneralHelp wanted with memory leaks... Pin
2sky25-May-01 7:56
2sky25-May-01 7:56 

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.