Hi all,

I'm trying to update a small MDI editor I wrote as a learning project but I've run into some problems. The editor consists of the frame (with menu), client, MDI edit windows and is written in MASM. When I tried to add a status bar the problems began, the edit windows overlap the status bar and when I minimize the edit windows they vanish behind the status bar.

I tried to create another window inside the main window to contain the client window but this isn't working either. The edit windows won't gain focus, the menu won't work properly, and I'm very confused!

I also want to add a toolbar.

Any help would be appreciated.

Posted on 2001-09-10 22:57:22 by Maelstrom
The problem here is that the client window takes the full window size.. I solved this my manually adjusting it's size in the WM_SIZE handler of the main window. Here's some code to give you an idea:

; get main window size
invoke GetClientRect, hWnd, ADDR clientrect

; force rebar and status window to adjust it's size:
invoke SendMessage, hRebar, WM_SIZE, wParam, lParam
invoke SendMessage, hStatus, WM_SIZE, wParam, lParam

; get size of rebar and status, substract it from main window size
invoke GetWindowRect, hRebar, ADDR temprect
mov eax, temprect.bottom
sub eax, temprect.top
inc eax
add clientrect.top, eax
invoke GetWindowRect, hStatus, ADDR temprect
mov eax, temprect.bottom
sub eax, temprect.top
inc eax
sub clientrect.bottom, eax

; convert .right and .bottom as width and height (works easier):
mov eax, clientrect.left
sub clientrect.right, eax
mov eax, clientrect.top
sub clientrect.bottom, eax

; set mdi client window size:
invoke MoveWindow, hWndMDIClient, clientrect.left, clientrect.top,\
clientrect.right, clientrect.bottom, 1
Posted on 2001-09-11 01:27:15 by Thomas
Thanks Thomas, although I do feel a little stupid for not thinking of it myself.
Posted on 2001-09-11 18:03:42 by Maelstrom