Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 576
  • Last Modified:

Detecting Button down on an MFC Toolbars, in Windows 95

I trying to detect when a user is pressing a toolbar button down.  I need to perform a routinue whilst this is happening.  But the MFC, from what I can see only picks up the Mouse Pressed, which is when the mouse button has been released.

Could you tell me if this is possible and how to go about it.
0
gibson
Asked:
gibson
1 Solution
 
mbhaktaCommented:
There are several ways you can attack this problem. I will explain you a very simple way.

The toolbars in MFC work in a message-architecture. That means the menus and toolbars in a MFC document-view architecture work hand-in-hand. What you need to do is make ON_COMMAND actions for every toolbar viz. a menu. Say if you have a toolbar with ID say ID_XYZ_ABC. Create a menu item with the same ID. Now go into classwizard. Find this menuitem and activate the ON_COMMAND action in the classwizard. This is like a OnLButtonDown(). Other features like tick, radio button behaviour can be added using ON_COMMAND_UI method. This way you can make your toolbar work the way you want. In this method code call your function.

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now