Thread: How can I...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    18

    How can I...

    How can I detect a WM_LBUTTONDOWN on a progress bar control? I tried setting a default action for this event in the dialog so that the form can be dragged around, but this only works for my Statics and the form itself. I want to be able to drag the dialog around by clicking on the progress bars...

    How can I do this???

    Any help is appreciated and sorry, I know I am being quite the pain in the ass.
    ~void

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    18

    :(

    Nobody can help huh ;(
    ~void

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    One solution is to derive a class from CProgressCtrl class and implement your own WM_LBUTTONDOWN handler.

    Kuphryn

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    There are general messages for the common controls (see Common Control Notification Messages on msdn), including progress bars, sent in the form of WM_NOTIFY: NM_CLICK for left mouse click, NM_RCLICK for right mouse click.

    If you prefer to handle the WM_LBUTTONDOWN explicitly then window subclassing is required; a search of this board will find numerous examples and discussions that should help out.

    Hope that helps.

    Edit: Forget about notification messages as they don't seem to be sent to the parent - subclass instead (API) or follow Kuphryn's suggestion for mfc. Sorry about any confusion caused.
    Last edited by Ken Fitlike; 10-22-2002 at 04:31 PM.

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> Nobody can help huh ;(

    Please don't bump your own threads, it is against the board rules. Also, remember that people are in different time zones around the world, it can, and often does take more than 24 hours to get a reply, bumping after just a few hours is bordering on simply being rude.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Or have you tried a WM_PARENTNOTIFY msg?

    with

    if(WM_RBUTTONDOWN==(WPARAM)wParam)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  7. #7
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>Or have you tried a WM_PARENTNOTIFY msg?<<

    No. I always forget that one. But thanks for the reminder. It seems to be the simplest and quickest (API) solution.

Popular pages Recent additions subscribe to a feed