Solved

Detecting Button down on an MFC Toolbars, in Windows 95

Posted on 1997-02-13
1
553 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
Comment Utility
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 run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 147
repeateFront java challenge 31 86
substring method in java 1 79
changeXy challenge 13 56
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

772 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

10 Experts available now in Live!

Get 1:1 Help Now