Click here to Skip to main content
16,011,570 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFixed.... Pin
Lockhart22-Mar-02 9:18
Lockhart22-Mar-02 9:18 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Stan Shannon16-Mar-02 1:59
Stan Shannon16-Mar-02 1:59 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Lockhart16-Mar-02 2:22
Lockhart16-Mar-02 2:22 
GeneralRe: VC++ 6.0 string bug ? (take a look plz) Pin
Stan Shannon16-Mar-02 2:45
Stan Shannon16-Mar-02 2:45 
GeneralRe: Are you running the latest VC6? Pin
Tim Smith16-Mar-02 3:39
Tim Smith16-Mar-02 3:39 
GeneralRe: Are you running the latest VC6? Pin
Lockhart16-Mar-02 4:39
Lockhart16-Mar-02 4:39 
GeneralDouble Click on List Control Pin
15-Mar-02 22:35
suss15-Mar-02 22:35 
GeneralRe: Double Click on List Control Pin
Christopher Duncan16-Mar-02 7:40
Christopher Duncan16-Mar-02 7:40 
Anonymous wrote:
i need to trap double click of a list control

Here's how I handled that situation - I wanted to double click on a list control item and pop it up in a message box. Sorry about the lack of formatting, I'm sure there's a way to do that but...

First, handled NM_DBLCLK,

ON_NOTIFY(NM_DBLCLK, IDC_MSG, OnDblclkMsg)

then,

void CTestAppDlg::OnDblclkMsg(NMHDR* pNMHDR, LRESULT* pResult)
{
// m_lcMsg is the list control
POSITION pos = m_lcMsg.GetFirstSelectedItemPosition();
if (pos) {
int iItem = m_lcMsg.GetNextSelectedItem(pos);
if (-1 != iItem) {
// this is just data that I associated when I added the item
MsgData* pData = (MsgData*)m_lcMsg.GetItemData(iItem);
if (GOOD_PTR(pData, MsgData)) {
MessageBox(pData->strFullMsg);
}
}
}

*pResult = 0;
}

One thing you need to be aware of is that unless you set a flag for selecting the entire row, you must double click on the first column or the click is ignored. You can do that with a call in OnInitDialog() like this:

m_lcMsg.SetExtendedStyle(m_lcMsg.GetExtendedStyle() | LVS_EX_FULLROWSELECT);

Hope this helps...

Chistopher Duncan
Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)
GeneralRe: Double Click on List Control Pin
Derek Waters17-Mar-02 12:36
Derek Waters17-Mar-02 12:36 
GeneralPlaySound and SND_RESOURCE Pin
Rickard Andersson2015-Mar-02 21:48
Rickard Andersson2015-Mar-02 21:48 
QuestionHow to create multithread? Pin
15-Mar-02 21:23
suss15-Mar-02 21:23 
AnswerRe: How to create multithread? Pin
Mazdak15-Mar-02 21:37
Mazdak15-Mar-02 21:37 
GeneralRe: How to create multithread? Pin
15-Mar-02 21:45
suss15-Mar-02 21:45 
GeneralRe: How to create multithread? Pin
Nish Nishant15-Mar-02 22:13
sitebuilderNish Nishant15-Mar-02 22:13 
GeneralRe: How to create multithread? Any example? Pin
16-Mar-02 6:53
suss16-Mar-02 6:53 
QuestionClient/Server programming over internet??? Pin
Rickard Andersson2015-Mar-02 20:47
Rickard Andersson2015-Mar-02 20:47 
AnswerRe: Client/Server programming over internet??? Pin
Nish Nishant15-Mar-02 21:07
sitebuilderNish Nishant15-Mar-02 21:07 
GeneralRe: Client/Server programming over internet??? Pin
Rickard Andersson2015-Mar-02 21:44
Rickard Andersson2015-Mar-02 21:44 
GeneralRe: Client/Server programming over internet??? Pin
Nish Nishant15-Mar-02 22:00
sitebuilderNish Nishant15-Mar-02 22:00 
GeneralRe: Client/Server programming over internet??? Pin
Rickard Andersson2015-Mar-02 22:20
Rickard Andersson2015-Mar-02 22:20 
QuestionHow do you call a default view in MDI application? Pin
Jasmyn15-Mar-02 19:55
Jasmyn15-Mar-02 19:55 
GeneralA strange problem! Pin
Davidlou15-Mar-02 18:42
Davidlou15-Mar-02 18:42 
GeneralRe: A strange problem! Pin
Nish Nishant15-Mar-02 18:42
sitebuilderNish Nishant15-Mar-02 18:42 
GeneralRe: A strange problem! Pin
Davidlou15-Mar-02 19:00
Davidlou15-Mar-02 19:00 
GeneralRe: A strange problem! Pin
Christian Graus15-Mar-02 19:06
protectorChristian Graus15-Mar-02 19:06 

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.