Menus in Child Windows


I've created a class derived from framewnd that I need to include in
side a dialog as a Child Window. I would like it to continue to have
the Menu/Tool bars....
       When this is used as the main (non-child windows), the menu
shows up properly.
       When I create it with the WS_CHILD, the menus disappear,
however, the toolbar remains....
       What is the process for having the Menu remain, even though
style is WS_CHILD.


10/19/2005 4:41:19 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 11

This is probably a Really Bad Idea.  A child dialog window by definition has no frame, no
menu, and no toolbar, so it is behaving as it is supposed to.  In fact, in the debug
version, it used to assert if you didn't have all the styles set properly.  CFrameWnds
have additional semantics insofar as message routing, and to embed one in a dialog would
lead to various forms of madness (think about a frame window routing to a view...).

Unfortunately, Microsoft doesn't give us a CMenuCtrl class that would implement menus
anywhere, because menus are tied into the nonclient area behavior of  a window, and thus
are not independent entities.  What I'd probably do if I needed to do a menu-like entity
would be to create a control derived from CStatic which I painted myself, put the
top-level menu text in it, and do a TrackPopupMenu sort of reaction if the mouse clicked
in it.  Admittedly a clumsy approach, but it would be merely tedious, instead of something
that would threaten my sanity. [OK, OK, I see all the followups, "What sanity?".  Yeah, if
I were sane I'd have an ethicectomy, become some kind of financial promoter, and make
millions, but I mean, "more insane than most programmers"]
On 19 Oct 2005 09:41:19 -0700, "Dhaval" <> wrote:

>I've created a class derived from framewnd that I need to include in
>side a dialog as a Child Window. I would like it to continue to have
>the Menu/Tool bars....
>       When this is used as the main (non-child windows), the menu
>shows up properly.
>       When I create it with the WS_CHILD, the menus disappear,
>however, the toolbar remains....
>       What is the process for having the Menu remain, even though
>style is WS_CHILD.
Joseph M. Newcomer [MVP]
MVP Tips:
newcomer (15975)
10/19/2005 7:57:25 PM

Similar Artilces:

Windows mail problem 07-16-10
Tried to log into my optonline account and received the following message: The connection to the server has failed. Account: '', Server: '', Protocol: POP3, Port: 995, Secure(SSL): Yes, Socket Error: 10060, Error Number: 0x800CCC0E Can anyone decipher this for me? What is the issue? You should not be using advanced ports or SSL, see*4k&p_accessibility=0&p_redirect=&p_lva=&p_sp=cF9zcmNoPSZ...

Find/Replace command in Windows Live Mail
Does anyone know if the Find/Replace command is available in Live Mail. I cannot find it. If not, does anyone know of a suitable solution for that "will be missed" command. No, it's not. If you need to use Find/Replace, select all the text and 'cut' it. Then paste into Notepad where you can do the Find/Replace. When done, paste the result back into your email message. Gary VanderMolen, Microsoft MVP (Mail) "LouiseL" wrote in message Does anyone know if the Find/Replace command is ava...

windows/system32/config/system file is huge
Hi, My windows/system32/config/system file is huge -- the order of 200mb. This seems a bit unusual, and I did get some popups on startup that there is not enough room for the registry. I cleared out the paging file and reallocated 1.5*2gb (the size of my memory). Anyway, what can I do about this file to make it "normal" again? I will state that I am after a repair install because something happened to my system and I needed to repair. Now things are indeed working alot better, but there is still this issue, and I guess this is why my system works slowly at times a...

Windows 2000 server user names
Where can I configure the user names formatting like you do in Recipient policies? yaro ...

Windows installer problem 04-08-10
Hi All, After login to windows xp, on screen displayed windows installer and nothing showing on screen .Any reply will be appreciated. Best regards Anji Always state your full Windows version (e.g., WinXP SP3; WinXP 64-bit SP2) when posting in a forum or newsgroup. Please do so in your next reply. Was the computer fully patched at Windows Update when this problem started? What anti-virus application or security suite is installed and is your subscription current? What anti-spyware applications (other than Defender)? What third-party firewall (if any)? Has a(another)...

Recipient Policy filtered by Child Domain:
We are in the process of deploying an Exchange system that will have multiple child domains in a single forest. Because some of these Child domaisn have a different internet domain name I'd like to be able to create a Recipient Policy that filters based on what child domain that person belongs to. While I've been able to create filters based on OU, etc... I've not seen anything allows me to filter for say Child1.Domain.Local vs Child2.Domain.local. Is this possible? Thanks. Michael Edward Kohlman "Michael Edward Kohlman" <> wrote: &g...

Regsitry Key inaccessable in Windows 2003
Hi all, I cannt access a Registry Entry from windows 2003. Works fine with Windows 2000. I am accesing it from a Service in vc++. If i change the service Run as to Administrative Account it works, but fails in local account. No problem at all in Windows 2000. Any Clues??? Thanks and Regards, Abhinav Have you checked if you have the correct permissions to access that key using a local account on the 2003 box? - MR "Abhi" <> wrote in message news:u0cjdDP4EHA.2608@TK2MSFTNGP10.phx.gbl... > Hi all, > > I cannt access a Registry Entry from win...

A question on __declspec(dllimport) and the Windows APIs.
In chapter 19 of Jeff's classic book "Programming Applications for Microsoft Windows", there is a paragraph as follows: "What Importing Really Means The previous section introduced the _ _declspec(dllimport) modifier. When you import a symbol, you do not have to use the _ _declspec(dllimport) keyword-you can simply use the standard C extern keyword. However, the compiler can produce slightly more efficient code if it knows ahead of time that the symbol you are referencing will be imported from a DLL's .lib file. So I highly recommend that you use the _ _declspec(dllimp...

Rules window disappears in less than 1 second
I just installed Outlook 2003 and now when I click on Rules the Rules dialog ox pops up for less that 1 second and then disappears not allowing any entry into it for editing and or setting up a rule. Any Ideas? ...

windows mail- vista, error with downloading attachments
When i click on the attachment it asks for my approval and then i click open. Then an error appears which at the frame of the window(above) says C:/Users...temporaryinternetfiles... ,and below an X with a message saying: This file does not have a program associated with it for performing this action. Create an association in the set associations control panel . What do i have to do? Regards, Antonis You have to, "Create an association in the set associations control panel." Go to Start - Default Programs - "Associate a File Type or Protocol with a Program&q...

Problem with Static splitter window...
Hi, Iam trying to create splitter windows. I need my window to be split into two rows. And then, each of the two rows must be further split into 2 columns. I need it precisely like this because I need the splitter bar in both rows to be separate and independent. Can somebody help me find what's the problem in the following code? It does not create the lower splitter. Any help will be greatly appreciated. Thanks, Shirley BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { int nWidth, nHeight; nWidth = ::GetSystemMetrics(SM_CXMAXIMIZED); nHei...

Business Portal - Employee Pay
This window does not auto-populated from existing employee data in Business Portal HRM:SS. The Employee Profile/Dependent/Benefits etc. windows all populate immediately but the W-4 window requires that a Modify transaction be made by the employee and approved by the supervisor before it will display data. This is contrary to all other windows and confuses the employees. It provides a first-impression that is not good for their experience with Business Portal. Mike Lupro -- Mike Lupro ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestion...

How to set Excel to open a new window for each application
When I choose a spreadsheet to open, I want it to open a new window. This used to happen but now opens in the same instance, just hiding my original spreadsheet. How to I get it back to previous settings? Tools-->Options, View tab. Check Windows in Taskbar. ************ Anne Troy "Luke" <> wrote in message > When I choose a spreadsheet to open, I want it to open a new window. This > used to happen but now opens in the same instance, just hiding my ori...

Windows 7 stuck in "Preparing to Hibernate"
How do I override "Preparing to Hibernate" or "Preparing to Shutdown" ? It's been in this mode for over six hours. Nothing removes the blue screen w/these words. Nothing to do with Word, but just keep the on/off switch pressed. -- Hope this helps, Doug Robbins - Word MVP Please reply only to the newsgroups unless you wish to obtain my services on a paid professional basis. "lsmo64081" <> wrote in message > How do I override "P...

Windows Live mail takes much longer than ISP
My email service is through and hotmail but Windows Live does not display mail for sometime an hour after it is in Sky mail. Why is this happening. It was not a problem in Outlook Express. What is you setting under Tools/Options... General tab... Send/Receive messages... Check for new messages every "xx" minutes... reset "xx" to "10" (default = 30). If you needs something quicker, you can manually sync. "Bryan1345" <> wrote in message

Drawing the iconic window
Many years ago, it was possible to draw anything you wanted in the iconic window view. Today, it seems like the SHell has taken this over completely. I've got two problems: My app has no caption bar and no system menu, but I want to handle right-click on the taskbar icon. No messages appear to be generated to indicate any activity in the task bar icon. My app would like to custom-draw the iconic representation on the taskbar, such as drawing the icon and the caption. It does not appear this is possible. Note that the funny routine that MFC generates for dialog-based apps, that is suppose...

After I install a software in windows xp , how many changes have h
After I install a software in windows xp , how many changes have happen in registry? Because I need to read the value of registry ,please tell me all the changes in registry. I appreciate your help. -- jake After you install "a piece of software" in Windows, some number of registry keys, dependent entirely on whatever the person writing the installation decided should be modified, have been modified. In addition, once you run it, some other keys, defined by the person who coded it, and based on whatever actions the user has taken, will be changed. Each piece of software is ...

Restore Backup from Outlook 2003 into Windows 7(64)
Old laptop running XP; did backup of Outlook 2003 pst files using microsoft personal folders backup tool, to ext. hard drive. Connected hard drive to new laptop running Win 7(64). How do i restore the bu? All attempts met with error message saying I do not have authorization to access the file. Then tried to export the pst files from old laptop to ext hard drive. Connected hard drive to new laptop and tried to import the exported files into Outlook 2003. Got a similar message saying I did not have permission to access the selected files. Please help Bill. Submitted using http:/...

Windows 7 Multi-touch driver capability discovery and reboot probl
Hi, I created a Windows 7 multi-touch HID driver based on WDK EloMT sample. The driver works ok but I have the following problems that I don't know how to fix them. 1. After my driver is installed (without reboot), sometimes the computer property shows "Touch Input Available with 2 Touch Points", sometimes it shows "No Pen or Touch Input is available for this display". 2. After my driver is installed, most of the time the system won't ask for reboot but sometimes it will. If anyone can point me the direction of how to solve these inconsistenci...

Using Windows Mail in Windows &
I have been using Windows Mail (copied from Vista) in my Windows 7 computer for nearly 6 months without any problems. Now, since Windows update KB978542 was installed a couple of days ago it has stopped working. It appears as a running program in Windows Task manager but the user interface never appears. I have done a System Restore to before KB978542 and Windows Mail started working OK again, Repeated this three time so I have no doubt that it is KB978542 that has buggered it up. Has anyone else using Windows Mail in Windows 7 had this experience? Are MS purposely disabli...

See this correction patch for Microsoft Windows
--hanoxjmvugy Content-Type: multipart/related; boundary="geygsediuj"; type="multipart/alternative" --geygsediuj Content-Type: multipart/alternative; boundary="orxbebvyw" --orxbebvyw Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Customer this is the latest version of security update, the "October 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three new vulnerabilities. Install now to protect your computer. This ...

Windows defrag on exchange partition.
Hello, I am running win 2003 with exchange 2003. Is it safe and/or worthwhile doing a defrag on the partition that the exchange databases are located? thanks in advance... In my experence with 2k3, i havnt had any probelms. supprisingly but no real problems. i think its because (on my test box now) i have everything on one 40 gig logical drive (c:) with no RAID. Now, note: RAID may not play nice, i wouldnt try it on RAID until someone else who has done it says so... enjoy... Anthony "Simon" wrote: > Hello, > I am running win 2003 with exchange 2003. Is it safe and...

Problems with windows
I just got my computer cleaned up and downloaded some programs without having adobe back on and a window appeared and said "Windows cannot open this and gave yes and no options." I clicked "No." And a window opened and I moved it to Word and I can't open anything on windows any more. This comes up and I sure would like some wisdom on what to do. File Conversion: Select the encoding that makes your document readable Text encoding Windows default has a circle with a period in the center MS-DOS other en...

internet explorer mime type resubmit to window error
I have an web-app that can produce a receipt by submiting a html table into a new window and setting the mime type to Excel. This functionality works fine. If the user does not close this window and goes to create a new receipt then the excel plugin within explorer simply copies the data within the previous window into the new window and ignores the new data. Is there any solution to this problem? First, I don't know what I'm talking about. Second, it does sound like some kind of caching problem. Is there anyway you can force the web application to refresh the cached data? ...

Access Denied error while edit some of the GPOs in Windows 2003 AD
Hi We are unable to edit some of the GPOs (Default Domain Policy, etc) and getting Access Denied error. We checked the permission of SYSVOL folder and found Administrators (Domain), System and Authenticated Users have full control share permissions. Full access has been provided to Administrators, creator owner & System and read & execute permission has been provided to Authenticated users in Security tab. Can anyone help me to resolve the issue and also any doc is available to check the correct permissions with SYSVOL. Thanks in advance for help Regards Lal -...