Solved

Detecting Button down on an MFC Toolbars, in Windows 95

Posted on 1997-02-13
1
573 Views
Last Modified: 2013-11-20
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
Comment
Question by:gibson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
mbhakta earned 50 total points
ID: 1300299
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

623 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