Solved

Catch Button DOWN events

Posted on 1997-05-08
1
475 Views
Last Modified: 2013-11-20
I would like to build a momentary button that activates when pressed
and stops when released.  Sound simple?  However, I can't seem to find
any way to catch the mouse down event within the button.  I've tried
subclassing the button and using the OnChildNotify and this got me
some events but not the button down ones.  Does anybody have an example
on doing this?  I've been all through the MSDN CD-ROM without luck.

Thanks,

Ken West
0
Comment
Question by:Ken_West
1 Comment
 

Accepted Solution

by:
syed_dgreat earned 100 total points
ID: 1301418
Try using this:-

Derive a new class from CButton and provide two handlers:-
OnLButtonDown and OnLButtonUp.

First, whenever you press down the button (OnLButtonDown),
do whatever you want (you said
activates when pressed on it right?).
Then later you would stop whenever OnLButtonUp event is detected, you will stop whatever is activated.
Remember also, subclass this dlgitem in your OnInitDialog.

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now