CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Location
    Germany
    Posts
    63

    CListCtrl: Keeping mouse button pressed on scroll bar => no WMs come through

    Hi,

    I discovered a strange problem with CListrCtrl:
    I wrote an application which runs mulithreaded: The GUI-thread inserts log messages into a log window (CListCtrl) when it detects a window message which indicates that a new log item has been emitted by a logger.
    Problem:
    When you hold down the left mouse button on the scroll bar's "thumb"*1 of the list control those messages won't be processed.

    How can I solve this problem ?
    Keep in mind that the threads which produce the log shall not be affected too much regarding timing (they may do some time crtitical things).

    You may download the sample application attached to this thread to see what I mean (created with VC++ 6.0):
    After you started it you should see a dialog with two buttons. Pressing the [OK] button will create a second thread which simulates the log-event-sender which will be active for about 10 seconds producing one window message for a log-event per 10ms.
    During that time you may hold the scroll button and you'll see that no more items get inserted. If you release the mouse button items get inserted again ==> window messages can be received again by the GUI-thread.

    It would be great if anybody could give me a hint on how to work around that problem.
    Thanks in advance.

    __
    *1: This is called the "thumb" of a scroll bar (see msdn):
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by Stoodent; June 27th, 2006 at 08:54 AM.

  2. #2
    Join Date
    May 2006
    Posts
    327

    Re: CListCtrl: Keeping mouse button pressed on scroll bar => no WMs come through

    I hope the attached changed implementation is suitable for you.
    Attached Files Attached Files

  3. #3
    Join Date
    Mar 2002
    Location
    Germany
    Posts
    63

    Re: CListCtrl: Keeping mouse button pressed on scroll bar => no WMs come through

    Quote Originally Posted by Viorel
    I hope the attached changed implementation is suitable for you.
    Thank you very much,
    this was exactly I was looking for.

    Rating your answer: 100% (best possible)

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