News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MDI problem

Started by fushiyun, March 01, 2006, 03:01:43 PM

Previous topic - Next topic

fushiyun

i use MDI window as my project window.
when i add a new child window to MDI, this child name will append to main menu automatically.
code as follows:
invoke GetMenu,hWnd                    ;get main menu
mov hMainMenu,eax
invoke GetSubMenu,hMainMenu,1     ;get sub menu
mov ClientStruct.hWindowMenu,eax  ;the child window will append to this sub menu

but, i think to add this child name into a new popup menu which is inserted at a given sub menu.
code as follows:
menuname dd "Recent Files",0
local hChildMenu:dd
local hSubMenu:dd

invoke GetMenu,hWnd
invoke GetSubMenu,eax,0
mov hSubMenu,eax
invoke CreateMenu
mov hChildMenu,eax
invoke InsertMenu hSubMenu,5,MF_POPUP or MF_BYPOSITION, hChildMenu, addr menuname

but, in the top of RecentFiles menu, it has a Separator.
in RadAsm, it has no this Separator in the top of Recent Files menu.
Can anyone tell me how to do this.
thank.

Tedd

You could insert each of the menu items one at a time.
I don't think you're supposed to insert the contents of a popup menu directly into the middle of another popup menu; you insert the menu item that produces that popup menu.

So do you want...?

File
----
.
.
recent > file1
         file2
         file3


or

File
----
.
.
file1
file2
file3
No snowflake in an avalanche feels responsible.

fushiyun

it will display as
Recent Files -> --------
       file1
       file2
       file3


i want
Recent Files -> file1
      file2
      file3

Tedd

Tadaa!

[attachment deleted by admin]
No snowflake in an avalanche feels responsible.

fushiyun

thank Tedd offer a zip file.
but it is not that i want.


first of all, my English is poor.
so, my explain have a little problem.

i try to explain my problems.
in Multiple Document Interface (MDI), the system will automatically insert a menu item that indicates the new child name.
but, in the top of this menu item, the system will insert a separator.
i don't want this separator when a new child is created.
therefore, i create a new popup menu that is Recent Files.
i hope that the child name displays on this new popup menu.

but it will display as follows when a new MDI child is created.
Recent Files -> --------
       file1
       file2
       file3


i hope this style like RadASM's Recent Files.
Can anybody tell me how to do this.
thanks. :(

Tedd

I think this is just the way the mdi functions work - you can not change it.
If you want it to work in a different way, you will have to make it yourself.
When you create the new child, also add the menu item into the recent-files menu :wink
No snowflake in an avalanche feels responsible.

fushiyun

i know.
thank Tedd. :bg