CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    61

    How can I detect when user click on ListView's item ?

    Hello,
    I use Win32 simple application withough MFC support. It's only ListView control. It is create by CreateWindowEx(). What can I get message when user click on some item in this ListView. I tried to get WM_NOTIFY but it failed. I try this:

    MSG msg;
    HWND hWnd = CreateWindowEx(...);

    while(::GetMessage(&msg, hWnd, 0, 0))
    {
    switch (msg.message)
    {
    case WM_NOTIFY:
    {
    MessageBox("User send NOTIFY message");
    break;
    }
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }
    }

    The problem is that I never see this MessageBox().
    When I tried with other messages like WM_KEYDON, WM_CHAR, WM_CLOSE everythig is OK. So I wrong something in WM_NOTIFY code, but WHERE??
    Please help me !!
    Thank you in advance.

    Regards: Drago


  2. #2
    Join Date
    Oct 1999
    Location
    Broomfield, CO
    Posts
    3,382

    Re: How can I detect when user click on ListView's item ?

    Have you tried WM_COMMAND? I don't know if the listview was part of Win 3.1 in any form, but I believe the older controls continue to respond to WM_COMMAND messages. Just a thought...


  3. #3
    Join Date
    May 1999
    Posts
    61

    Re: How can I detect when user click on ListView's item ?

    Hi,
    Thats right but in MFC implementation most ListView messages are send with WM_NOTIFY.
    But I'll try WM_COMMAND.

    Reagrds: Drago


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured