Archived

This topic is now archived and is closed to further replies.

brassfish89

client window

Recommended Posts

brassfish89    122
I'm making an MDI app and I only have the client window take up part of the frame window (the other part is a toolbar). When I resize my frame window the client window takes up the whole thing instead of just part. Also, when I maximize a child window of the client window it maximizes ok but it doesn't show the buttons in the corner of the menu. Here's how I create my windows:
// client window

	CLIENTCREATESTRUCT ccs;

	// the handle to the 'window' submenu

	ccs.hWindowMenu=GetSubMenu(GetMenu(hwnd),1);

	// can be anything as long as it doesn't get mistooken as

	// a menu ID in the WndProc

	ccs.idFirstChild=50000;

	// create the client window

	client=CreateWindowEx(0,"mdiclient",0,
		WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,0,0,width-150,height,
		hwnd,0,hInstance,(LPVOID)&ccs);

	ShowWindow(client,SW_SHOWNORMAL);
	UpdateWindow(client);

// toolbar window

	// create the toolbar window

	toolBar=CreateWindowEx(WS_EX_TOPMOST,
		"toolbar",
		0,
		WS_CHILD|WS_VISIBLE,
		wWidth-150,
		0,
		150,
		wHeight,
		hwnd,
		0,
		hInstance,
		0);

	ShowWindow(toolBar,SW_SHOWNORMAL);
	UpdateWindow(toolBar);
and here's where I resize the windows:

			int _width=(int)LOWORD(lParam);
			int _height=(int)HIWORD(lParam);
			// reposition toolbar
			SetWindowPos(toolBar,HWND_TOP,_width-150,0,150,_height,SWP_SHOWWINDOW);

			// resize the client window
			SetWindowPos(client,0,0,0,_width-150,_height,SWP_NOZORDER);
  
thx brassfish
-If you see this image I may or may not be online My website

Share this post


Link to post
Share on other sites