Click here to Skip to main content
15,914,221 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Wierd CString Problem Pin
jbarton10-May-02 9:38
jbarton10-May-02 9:38 
GeneralDrawDibDraw() equivalent Pin
moredip9-May-02 12:12
moredip9-May-02 12:12 
GeneralRe: DrawDibDraw() equivalent Pin
Mike Nordell9-May-02 20:19
Mike Nordell9-May-02 20:19 
GeneralRe: DrawDibDraw() equivalent Pin
moredip10-May-02 5:48
moredip10-May-02 5:48 
GeneralRe: DrawDibDraw() equivalent Pin
Mike Nordell21-May-02 5:34
Mike Nordell21-May-02 5:34 
GeneralRe: DrawDibDraw() equivalent Pin
moredip21-May-02 7:51
moredip21-May-02 7:51 
GeneralDoubleClick Area Validation in CListView :: MFC Pin
valikac9-May-02 11:48
valikac9-May-02 11:48 
GeneralRe: DoubleClick Area Validation in CListView :: MFC Pin
Tom Archer9-May-02 22:16
Tom Archer9-May-02 22:16 
kuphryn wrote:
I used the exact code Jeff Prosise presents in his book

Actually I cover this in my MFC book :P

Seriously, I don't have Jeff's book, but I'm sure it's very good. Here's what you need to do:


  1. Implement a handler for WM_LBUTTONDBLCLICK
  2. Modify the handler like this
    void CListViewDemoView::OnLButtonDblClk(UINT nFlags, CPoint point)
    {
     CListView::OnLButtonDblClk(nFlags, point);
    
     CListCtrl& list = GetListCtrl();
    
     int iIndex;
     point.x = 2;
    
     if ((iIndex = list.HitTest(point, NULL)) != -1)
     {
      list.SetItemState(iIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
    
      int index = list.GetNextItem(-1, LVNI_ALL | LVNI_SELECTED);
      CString str = list.GetItemText(index, 0);
      AfxMessageBox(str);
     }
    }




Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
GeneralRe: DoubleClick Area Validation in CListView :: MFC Pin
valikac10-May-02 4:53
valikac10-May-02 4:53 
GeneralRe: DoubleClick Area Validation in CListView :: MFC Pin
Tom Archer10-May-02 5:18
Tom Archer10-May-02 5:18 
GeneralLib Errors Pin
stupration9-May-02 11:43
stupration9-May-02 11:43 
GeneralRe: Lib Errors Pin
Joaquín M López Muñoz9-May-02 11:46
Joaquín M López Muñoz9-May-02 11:46 
GeneralRe: Lib Errors Pin
stupration9-May-02 12:09
stupration9-May-02 12:09 
GeneralRe: Lib Errors Pin
Joaquín M López Muñoz9-May-02 20:01
Joaquín M López Muñoz9-May-02 20:01 
GeneralRe: Lib Errors Pin
Mike Nordell9-May-02 20:24
Mike Nordell9-May-02 20:24 
GeneralRe: Lib Errors Pin
stupration10-May-02 12:54
stupration10-May-02 12:54 
GeneralRe: Lib Errors Pin
stupration10-May-02 13:10
stupration10-May-02 13:10 
Questionhow to detect that a window is flashing Pin
MaxiGroovy9-May-02 11:32
MaxiGroovy9-May-02 11:32 
AnswerRe: how to detect that a window is flashing Pin
Mike Nordell9-May-02 20:25
Mike Nordell9-May-02 20:25 
GeneralOptional Push-Buttons Around Frame :: MFC Pin
valikac9-May-02 11:14
valikac9-May-02 11:14 
GeneralRe: Optional Push-Buttons Around Frame :: MFC Pin
James R. Twine10-May-02 10:22
James R. Twine10-May-02 10:22 
GeneralRe: Optional Push-Buttons Around Frame :: MFC Pin
valikac10-May-02 10:27
valikac10-May-02 10:27 
GeneralRe: Optional Push-Buttons Around Frame :: MFC Pin
James R. Twine10-May-02 10:34
James R. Twine10-May-02 10:34 
GeneralPointers Pin
Peter Liddle9-May-02 10:59
Peter Liddle9-May-02 10:59 
GeneralRe: Pointers Pin
Joaquín M López Muñoz9-May-02 11:11
Joaquín M López Muñoz9-May-02 11:11 

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.