15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


window menu in menubar Q ?

Danny Lauwers -- dlauwers@innet.be
Friday, January 03, 1997

Environment : VC++ 4.2b, Windows NT 4.0 (sp1)

Hello,

I have an application where I use the Document/View concept to view the data
of my program. I also created a window that can Preview the data comming
from an external device before it is "read" into a new document. This
preview window is a CMDIChildWnd to make it live inside the MDI-Frame. The
operation of all this works fine. But I don't want the Preview window's name
to appear in the list of open windows under the menu (mostly the second menu
from your right). I know that this is an automatic MDI-feature I get for
free when I use a CMDIChildWnd, but I need most of the CMDIChildWnd
functionality but not the reference in the window-list menu in the menubar. 
I have made the preview window CFrameWnd, and the window-list was correct
now, but all the other extra's where gone too. I could position the window
within my main-Frame, but over my controlbar at the bottom. The
window-caption never hilights,...
Does anybody know a way to tell the MDI-engine not to include a certain
window in the window-list menu, or maybe some other sollutions. I have tried
to locate the function or piece of code via the browser that is responsible
for handeling this. I traced it to some pointers to menu's some levels deep
in MFC that are used in a call to a win32 function (I forgot the name, ?)
but that is as far as I could debug ! You have a pointer to the complete
menu and a pointer to the window-list (sub)menu.
You can follow that in :
1.        HMENU CMDIFrameWnd::GetWindowMenuPopup(HMENU hMenuBar)

2.       _AFXWIN_INLINE CMenu* CMDIFrameWnd::MDISetMenu(CMenu* pFrameMenu,
CMenu*pWindowMenu)

3.      void CMDIFrameWnd::OnUpdateFrameMenu(HMENU hMenuAlt)


Thanks
Danny Lauwers

==============================================================================
Ing. Danny Lauwers (dlauwers@innet.be) 
Intersoft Electronics		        Radar verification Hard- & software
Lammerdries 27			       	Fotofinish and timing of sportevents
2250 Olen Belgium Europe	        Footscan applications
Tel: +32 14 231811			and more ...
Fax: +32 14 231944			Checkout http://www.innet.be/intersoft
===============================================================================




Ian Pepper -- Ian@flexicom.ie
Friday, January 03, 1997

Hi Danny,

How about using a modeless dialog box instead.  Just a thought.

Ian
ian@flexicom.ie

>



Dong Chen -- d_chen@ix.netcom.com
Saturday, January 04, 1997

Would it be an option if you use your own menu for this CMDIChildWnd window?
Since you don't want to see it in the window list, I guess you don't want to
arrange it by tiling and cascading it either. So you can simply remove the
whole Window popup menu.
You can do this by creating another menu using the resource editor,  adding
a CMenu member variable in your mainframe class and loading it using
LoadMenu(IDxx). When you have your preview window up, call SetMenu and
DrawMenuBar for it. After you close it, the mainframe menu will be used.
Hope this helps.
Dong
d_chen@ix.netcom.com





| Вернуться в корень Архива |