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
Solved

Detecting Button down on an MFC Toolbars, in Windows 95

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Complete beginner needs help making a cron job 9 125
sameEnds challenge 3 179
java ^ examples 8 69
sumHeights  challenge 17 73
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.

809 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