Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6070921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:59:18+00:00 2026-05-23T09:59:18+00:00

I created a context menu using CreatePopupMenu(). I then added menu entries using InsertMenu(..),

  • 0

I created a context menu using CreatePopupMenu(). I then added menu entries using InsertMenu(..), displayed it with TrackPopupMenu(..).

A few questions:

  1. Where do the window messages get sent when I click on something in the context menu? The MSDN docs do a great job of explaining how to create a context menu, but once you have it I’m unsure of how to handle it.

  2. The docs specify that I need to call DestroyMenu(HMENU hMenu) after TrackPopupMenu. I’ve written that into my app, but I don’t quite understand what’s going on here. If I just created a menu, wouldn’t DestroyMenu() destroy it? In other words, what is it destroying?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:59:18+00:00Added an answer on May 23, 2026 at 9:59 am

    When you click an item in the popup menu, the operating system will send a WM_COMMAND message to the window that ‘owns’ the popup menu, that is, more specifically, to the window you specified in your call to TrackPopupMenu (the hWnd parameter).

    When you create a menu, the operating system will reserve memory to store information about the menu. When you no longer need the menu (when you know you will never display it again), you can free this memory by calling DestroyMenu.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a label using the new label context menu: I defined the parameters
I am using the the following code for a context menu and then if
In my soundboard app I have created a context menu using this code. public
Is it possible to resize an openGL window (or device context) created with wglCreateContext
I need to create a context menu, is it possible to do this using
I added a custom menu to the menu button using the following code: @Override
Suppose I am using a context menu to add child nodes to a treeview
I have two activities that both contain an identical context menu built programmatically using
I have an application which runs using the context menu of windows explorer. I
I don't get it. I created a folder. Added it using the SVN Add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.