Все вроде правильно, окна создаю через CreateMDIСhild И пример в статье про MDI у меня нерабочий. Весь набор и сам код: Код (Text): .486 .model flat include kernel.inc include user.inc include comdlg.inc include comctl.inc include iee.inc min_h equ 70h min_w equ 12ah .code assume fs:nothing public _start FW_MDICHILD equ 500h err_heap equ 0 err_mem equ 4 err_class equ 8 err_wnd equ 12 err_size equ 16 err_: ret _start: push excpt1_ push dword ptr fs:[0] mov fs:[0],esp xor ebx,ebx mov esi,esp push ebx call GetModuleHandle mov hinst,eax call GetProcessHeap push 1024 push HEAP_ZERO_MEMORY push eax call HeapAlloc test eax,eax jnz @f xor ecx,ecx err1_: pop dword ptr fs:[0] add esp,4 ret @@: mov heap,eax push PAGE_READWRITE push MEM_COMMIT push 200000h push 0 call VirtualAlloc test eax,eax jnz @f mov ecx,err_mem jmp err1_ @@: mov hmem,eax push ebx push offset nclass push offset nmenu push COLOR_MENU+1 push IDC_ARROW push ebx call LoadCursor push eax push IDI_WINLOGO push ebx call LoadIcon push eax mov ecx,hinst push ecx push ebx push ebx push wndproc push CS_HREDRAW+CS_VREDRAW push 48 push esp call RegisterClassEx test eax,eax jnz @f mov esp,esi mov ecx,err_class push end_ jmp err_ @@: mov edx,DefMDIChildProc mov [esp+8],edx mov ecx,COLOR_WINDOW+1 mov [esp+32],ecx lea eax,nmdiclass mov [esp+40],eax push esp call RegisterClassEx mov esp,esi test eax,eax jnz @f mov ecx,err_class push end_ jmp err_ @@: push ebx mov eax,hinst push eax push ebx push ebx mov ecx,CW_USEDEFAULT push ecx push ecx push ecx push ecx push WS_OVERLAPPEDWINDOW+WS_VISIBLE push offset nwnd push offset nclass push ebx call CreateWindowEx mov ecx,err_wnd test eax,eax jz err_ push eax mov hwnd,eax call UpdateWindow sub esp,28 mov msg,esp cycl_msg: push ebx push ebx push ebx mov edx,msg push edx call GetMessage test eax,eax jnz @f add esp,28 end_: pop dword ptr fs:[0] add esp,4 excpt1_: mov ecx,hmem push MEM_RELEASE push ebx push ecx call VirtualFree mov eax,1 ret @@: cmp eax,-1 jnz @f push end_ jmp err_ @@: mov edx,msg push edx call TranslateMessage mov ecx,msg push ecx call DispatchMessage jmp cycl_msg align 4 wndproc: mov eax,[esp+8] xor ebx,ebx cmp eax,WM_CREATE je create cmp eax,WM_DESTROY je destroy cmp eax,WM_COMMAND je command cmp eax,WM_GETMINMAXINFO je minmax ; cmp eax,WM_WINDOWPOSCHANGED ; je poschng frmproc: pop ecx pop edx mov eax,hmdiclnt push eax push edx push ecx jmp DefFrameProc destroy: push ebx call PostQuitMessage xor eax,eax ret 16 minmax: mov eax,[esp+16] mov ecx,min_w mov edx,min_h add eax,18h mov [eax],ecx mov [eax+4],edx xor eax,eax ret 16 create: push ICC_TREEVIEW_CLASSES+ICC_BAR_CLASSES push 8 push esp call InitCommonControlsEx ; push 1 ; mov ecx,[esp+16] ; push ecx ; push ebx ; push WS_CHILD+WS_VISIBLE ; call CreateStatusWindow ; test eax,eax ; jnz @f ; mov ecx,err_wnd ; push destroy ; jmp err_ @@: ; mov hstatus,eax push 1 mov edx,[esp+16] push edx call GetMenu push eax call GetSubMenu push eax push FW_MDICHILD mov ecx,esp push 't' push 'neil' push 'cidm' mov edx,esp push ecx mov eax,hinst push eax push 0cach mov ecx,[esp+44] push ecx push ebx push ebx push ebx push ebx push WS_CLIPCHILDREN+WS_CHILD+WS_HSCROLL+WS_VSCROLL+WS_VISIBLE push ebx push edx push ebx call CreateWindowEx add esp,28 test eax,eax jnz @f mov ecx,err_wnd push destroy jmp err_ @@: mov hmdiclnt,eax xor eax,eax ret 16 poschng: push ebx push ebx push 5 mov eax,hstatus push eax call SendMessage jmp frmproc xor eax,eax ret 16 command: mov eax,[esp+12] and eax,0ffffh cmp eax,IDM_WINDOW jae frmproc sub eax,100h jmp [_cmd+eax] _cmdopen: push ebx mov eax,hinst push eax mov edx,hmdiclnt push edx sub esp,16 push esp push edx call GetClientRect push WS_VISIBLE+WS_HSCROLL+WS_VSCROLL lea eax,nwnd push eax lea ecx,nmdiclass push ecx call CreateMDIWindow xor eax,eax ret 16 _cmdsave: xor eax,eax ret 16 _cmdquit: jmp destroy align 4 _cmd dd _cmdopen,_cmdsave,_cmdquit nmenu db 'MENU1',0 nclass db 'IEE01',0 nmdiclass db 'GENMDIWND',0 nwnd db 'IEE',0 name_about db 'ABOUT',0 .data? align 4 msg dd ? hinst dd ? hwnd dd ? hmdiclnt dd ? hstatus dd ? hmdichld dd ? heap dd ? hmem dd ? end 1018456522__Iee.zip
zzzyab У тебя Код (Text): ... push 1 mov edx,[esp+16] push edx call GetMenu push eax call GetSubMenu push eax push FW_MDICHILD mov ecx,esp ... а надо Код (Text): ... push FW_MDICHILD push 1 mov edx,[esp+20] push edx call GetMenu push eax call GetSubMenu push eax mov ecx,esp ... ибо CLIENTCREATESTRUCT выглядит так Код (Text): typedef struct { HANDLE hWindowMenu; UINT idFirstChild; } CLIENTCREATESTRUCT, *LPCLIENTCREATESTRUCT;