Menu item changed event

I am using TrackPopupMenu() to display a popup menu and allow a user to make 
a selection.  I would like to have an event occur (have a method called) each 
time the selected item in the menu changes.  In other words, as the user 
moves the mouse up and down the menu, as a menu item becomes selected (not 
clicked, simply highlighted), I would like an opportunity to take an action 
(such as display information regarding what will occur if the user selects 
that menu option).

Thanks

0
Banner (52)
8/13/2004 5:17:01 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
464 Views

Similar Articles

[PageSpeed] 18

>I am using TrackPopupMenu() to display a popup menu and allow a user to make 
>a selection.  I would like to have an event occur (have a method called) each 
>time the selected item in the menu changes.

Try handling WM_MENUSELECT.

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2063)
8/13/2004 11:30:51 AM
Banner wrote:

> I am using TrackPopupMenu() to display a popup menu and allow a user to make 
> a selection.  I would like to have an event occur (have a method called) each 
> time the selected item in the menu changes.  In other words, as the user 
> moves the mouse up and down the menu, as a menu item becomes selected (not 
> clicked, simply highlighted), I would like an opportunity to take an action 
> (such as display information regarding what will occur if the user selects 
> that menu option).
> 
> Thanks
> 

If the menu sends a message each time the selected item changes then you 
can observe this and find our what the message is by using the Spy++ 
tool that comes with VC.  It will display all messages coming in to a 
selected window.

If there is no message then you can use the owner-drawn menu feature to 
draw the menu with your own code.  (This is how the MS applications make 
their pretty menus.)  The owner-draw code will receive notifications 
each time the selected item changes.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
8/13/2004 12:11:14 PM
Thank you very much, that did the trick perfectly. :)

"David Lowndes" wrote:

> >I am using TrackPopupMenu() to display a popup menu and allow a user to make 
> >a selection.  I would like to have an event occur (have a method called) each 
> >time the selected item in the menu changes.
> 
> Try handling WM_MENUSELECT.
> 
> Dave
> -- 
> MVP VC++ FAQ: http://www.mvps.org/vcfaq
> 
0
Banner (52)
8/13/2004 12:49:01 PM
>The use of Spy was a good idea had I not been able to determine a message in 
>another way.

Spy++ is invaluable, you should give it a go. It's what I used to
check which message you needed.

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2063)
8/14/2004 12:03:17 AM
Reply:

Similar Artilces:

Serialized items sales question
Is there any way to prevent the sale of serialized items when a customer is not associated with the invoice? ...

Menu
The Menu bar (File,Edit,View,etc ) disappeared from our OL. How do we get it back please. Trying Tools\Customize does not seem to do it since the Built in menu option as missing from there. Office 2003 Pro with SP1. -- Peter Please reply to Newsgroup for the benefit of others. Problem solved with Repair -- Peter Please reply to Newsgroup for the benefit of others. "Peter Foldes" <okf22@email.msn.com> wrote in message news:O1xL0w7LFHA.2888@TK2MSFTNGP12.phx.gbl... > The Menu bar (File,Edit,View,etc ) disappeared from our OL. How do we get > it back please. T...

can't change font in work sheet
I down loaded a calendar template from M/S but I want to change the numerical dates to an other font. I can change the numbers one at the time but I'm not about to to that to 365 numbers. I tried highlighting a month of numbers and changing the font but it still reverts back to the same font. I am assuming there has to be an easy way?? 2nd question. when I sync this template along with 3 other different types of template to my PDA. The calendar template month, days colors etc. were viewable, the numercial dates were not. Since other M/S templates were 100% viewable and the calendar...

How to change default de-limiter during import
Hi Folks, How do we change the default de-limiter in CRM during an import from excel (Tools -> Import). The only field seperator available in CRM, are: Comma (,) Tab (\t) Semicolon (;) Colon (:) I would like to add a Pipe (|), and a Tilde (~). Some of the Accounts/Contacts I am importing from excel, have a Comma, Tab, semicolon and a colon in their Account names as well. Thanks, ...

"recover deleted items" question
I have my deleted items set to 7 days server side & and in client outlook 2003 I have registry "DumpsterAlwaysOn" set to 1. How can I make it where users cannot delete the stuff in recover deleted items? I don't think that is supported. If you want everything saved, then implement message journaling. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "Mostro" <oveloz@glasfloss.com> wrote in message news:devj5j$c2v$1@newsdbm02.news.prodigy.com... >I have my deleted items set to 7 days server side & and ...

Get default event handler of a control.
Hello. How can I get/set the default event handler of a specific control ? (Any other event ?) I need a generic solution (such as reflection for setting properties values), please. Thanks :) Am 27.06.2010 23:17, schrieb Mr. X.: > How can I get/set the default event handler of a specific control ? (Any > other event ?) > I need a generic solution (such as reflection for setting properties > values), please. What's the default event handler? If you want to identify the default event, just check the list of events for the event which is marked using the...

Stop Excel Changing Format
In Excel I want to just show a date as dd/mm in a cell. Every time I enter this Excel shows the number in dd/mm/yy format, even when I change the cell to use the General format. Any idea how I get Excel to show the number as I want? Format as dd/mm -- David Biddulph "Chris762" <Chris762@discussions.microsoft.com> wrote in message news:D028B2CD-5096-4EB5-8FFF-249AD6839774@microsoft.com... > In Excel I want to just show a date as dd/mm in a cell. Every time I enter > this Excel shows the number in dd/mm/yy format, even when I change the > cell > to...

Logical Statement on a SwitchBoard Menu.
Is it possible to use a logical statement before open an switchboard menu. Example: Check if user is authorized to access that switchboard menu. Thank Ileana Yes but you would have to do that as part of the switchboard form not any part of the switchboard itself. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "iholder" <iholder@discussions.microsoft.com> wrote in message news:3FD4B318-845E-481E-B719-20D00B7190CE@microsoft.com... > Is it possible to use a logical statement before open an switc...

Item Type
How do I change an Item type? You can change between sales/inventory and discontinued as needed by going to the item card. If you need anything other than that then you have to do it through SQL -- Jim@TurboChef "rcr" wrote: > How do I change an Item type? Jim, We have some items that were set up with the type of Sales Inventory that should have been set up with the type of Misc Services. Can I just run a SQL update statement on the IV00101 table and change the type field? That should do it, right? "Jim@TurboChef" wrote: > You can change between sale...

Question on accessing a nested GridViews Events
Could somone please help: how do you access a GridView's events like SelectedIndexChanged when it's nested within another grid. the inner grid is populated via the outer grids rowdatabound. Here is an example of what my grids look like: http://www.giswiz.com/nested_gridview_dropdown/ I have a page with a nested Gridview control within an outer Gridview (Master/Child). ie: GridView1 -> GridView2. I have the inner grid being populated via the outer grids RowDatabound event. The goal of the whole thing is to show a customer record in the out...

Data/Values change when Query Analyzed in Excel
I have a query with 3 tables that represent master item list, count qty and as qty. When I look at the results in Query, all is well and accurate yet when I select Analyze with Excel, values change. For example, if a record shows zero qty in the as of field and zero quantity in the count field, I get a value in one or both of the fields that origianlly were zero. Other than linking the tables and grouping by master item list (to show all parts regardless of qty's), there are no formulas or expressions in this query. One of the tables is linked to a FoxPro table via ODBC driver. ...

How do I change format of page numbers to letters in Excel?
I need to create page numbers for multi-page Excel spread sheets that include subnumbers, which the client needs with some letter forms, as Page 2-f. Even with an Excel manual and the Help function I can't find out how to do this. My only alternative will be MANUALLY typing in those page numbers! Help! What sequence of alpha numerics do you need? With the automatic numbering provided in the headers/footers section I'm not sure how you would manually enter the sequence. Where does page numbering appear, and what is your desired outcome? The sequence would be, Page 1-(a, b, ...

Assigning values to a Validation Menu
I'm trying to do this thing on Excel where I have a list of values tha are being summed at the bottom of the page. Thats not a problem. Th problem I'm having is that one of the cells is a pull down lis (Validation) and I need to set it up so each of the choices (eg. A-1 B-2,...) has a specific value associated with it that will be added i with the rest of the sum. Anyone know how I can do this -- AlwaysAAnge ----------------------------------------------------------------------- AlwaysAAngel's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2728 View this...

Changing Serial Baud Rates
I've got a remote Bluetooth device that I'm trying to connect to, but its baud rate will be unknown when the application starts. There are only 5 baud rates that I can select from, so I can try each in succession until I get a response. What needs to be done on my end to change a baud rate? On HyperTerminal, whenever I change a baud rate in the settings, I have to close HyperTerminal and reopen it in order for those settings to take. Should my code disconnect/reconnect (i.e. CloseHandle/CreateFile), or is SetCommState all I need? Thanks for your help! ~Joe SetCommState wil...

Moving Contact Menu Items on the ISV file
I need help configuring the isv.config file to change the order of menu items on the contacts screen. I've seen the posts on how it remove items but I can't seem to move items on the menu. Thanks, Scott ...

change main segment ID
We are already using Great Plains for a few months now. We want to change the main segment ID as it is incorrect. Can I simply change it to the correct value and run checklinks on financial series. Is there any other danger of changing main segment ID in a system with existing data? Has anyone done this before? Jack, i have not done anything similar to this before, however my recommendation would be that you back your DB before you do anything with your server. In addition to that, create a BK-UP of live company and restore on the test DB and test it out on the test company. Rega...

Problem in adding new menu item to existing menu in GP
I want to add new form in Tools->Setup->Sales->new form. My GP version is 9.0 I had created procedure in which i am using AddCommandToMenu function to add menu. Status = AddCommandToMenu(DYNAMICS, resourceid(form Command_Sales), resourceid(command CL_Sales_Setup of form Command_Sales), Seq, CMD_BUILTINCMD_DICTID, resourceid(form Command_IOP), resourceid(command Cmd_IOP of form Command_IOP), true, MENULOAD_TOTABLE); Is it right way to add new menu item under existing GP menu or any other way to add menu item? I had tried also other way : menu_tag = Command_GetTag(command CL_...

Where is a User Synchronization event recorded?
I want to be able to report on when each of our users synchronize between Outlook and MS CRM but can't find if/where this information is stored in the database. Can anyone help? There are some subscription tables in the _MSCRM DB... "Adrian" wrote: > I want to be able to report on when each of our users synchronize between > Outlook and MS CRM but can't find if/where this information is stored in the > database. > > Can anyone help? ...

About HDN_TRACK event of CListView or CListCtrl
Did you ever encounter that HDN_TRACK event never sent for CListView or CListCtrl. I added an message handler of HDN_TRACK of an CListView. But it never happens. I also added message anders of HDN_BEGINTRACK & HDN_ENDTRACK, these two events happened as expected. Why HDN_TRACK never happen? Is there are some bugs in MFC? "Leon" <chi_jinliang@toyoda-tast.com> wrote in message news:%23XACfoz6FHA.1276@TK2MSFTNGP09.phx.gbl... > Did you ever encounter that HDN_TRACK event never sent for CListView or > CListCtrl. > > I added an message handler of HDN_TRACK of ...

mail doesn't go to sent items folder
I have the problem that mails don't get copied into the sent items folder although Outlook is configured right as far as I see. It only happens on two installations of Outlook 2002 (BETA!?! , which obviously should have been replaced a long time ago) ...

Unable to use the back/forward buttons in the OPEN menu
I recently upgraded to Excel 2007 and Windows 7. Previously I was able to ask the program to 'open' and then go back/forward through the folders to get to the next location as needed. Now I have to start over every time. The back and forward buttons are alway gray and the address bar is blank if I try to pull it down. Getting tired of having to use the Nav panel and start over every time.... Any ideas? Thanks! ...

My Save As menu is not working
Save As under the file menu in Excel is "grayed out" so I cannot select it. How can I fix this problem Hi, right-click the menubar select Customise from list >> Toolbars click Standard click Reset Button ok - Mark >-----Original Message----- >Save As under the file menu in Excel is "grayed out" so I cannot select it. >How can I fix this problem >. > ...

Event Viewer ID 9348 and Error 8004010F
We have reset our system folders on and Exchange Server 2003 (MS KB 822444) because of the errors listed below. After resetting the system folders we are still receiving the error messages and have found that in ADSI Edit there are duplicate records for the 403 and 81A records listed. The first of each is just 403 and 81A with the related information in the right-hand pane. The other two are listed as CN=403 CNF:1ba8fd50-0f60-48a8-89d0-ce36b85b9397 and CN=81A CNF:4be6223e-5a74-45ed-b8a5-cf5d17e844a3 with nothing in the right-hand pane. Can these two items be safely deleted from ADSI Edit? ...

random #'s for a population how do you sort w/o changing #'s
How do you use the sort filter smallest to largest? When I try I see that the numbers are changing not just reordering? Any ideas? Anna, As you correctly observe the numbers change because the sort causes the worrksheet to recalculate. There are a number of ways around it. One suggestion is copy your random numbers and paste special/paste values into another range and then sort this range -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Anna&qu...

RMS1.x Kit Item
Please help. I have 3 items which are sold individually and combined as a kit at the time of sale. How do I set them up so that the quantity of stock is updated when an item is sold individually or as a part of a kit. It is not practical in this situation to make the kits ahead of time. We are using version 1.x of RMS. Thanks. This is a multi-part message in MIME format. ------=_NextPart_000_004D_01C85DFF.5E037E30 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable jaguarsd1, Look at Assemblies instead. http://tinyurl.com/yss9rm Must h...