Solved

Detecting Button down on an MFC Toolbars, in Windows 95

Posted on 1997-02-13
1
556 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
unable to delete all specified values regedit 38 273
lucky13 challenge 11 120
isEverywhere  challenge 19 71
mapBully challenge 6 113
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

929 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

13 Experts available now in Live!

Get 1:1 Help Now