Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!ogicse!emory!sol.ctr.columbia.edu!ira.uka.de!smurf!gopnbg!altger!doitcr!salyko!darkness From: darkness@salyko.doit.sub.org (Stefan Willmeroth) Newsgroups: comp.windows.ms Subject: Re: Controls in parent window Message-ID: <2496@salyko.doit.sub.org> Date: 18 Oct 90 20:50:00 GMT References: <967@bjcong.bj.co.uk> Organization: CUBENet Munich Lines: 38 rkt@bjcong.bj.co.uk (RAKESH TANDON) writes: >I am trying to create an application which requires the parent window to >have controls (editboxs, push buttons etc). Under windows 2 I created a >dialog box with no border and made it fill the parent windows client area. >Is there a neater way of doing this in windows 3 ? You may create the needed controls via CreateWindow and place them anywhere you want in your main window. A simple example: GetClientRect(hWndMain,(LPRECT)&theRect); WinYD=theRect.bottom; hButton1=CreateWindow ( (LPSTR)"Button", (LPSTR)"Zoom", WS_CHILD|BS_DEFPUSHBUTTON, (int)0, (int)0, (int)40, (int)(WinYD/3), (HWND)hWndMain, (HMENU)PB_ZOOM, (HANDLE)hInst, (LPSTR)0); ShowWindow( hButton1, SW_SHOW); UpdateWindow(hButton1); When the user klicks on this pushbutton, you get its ID (PB_ZOOM in the example) through a WM_COMMAND message much like a menu selection. Greetings Stefan _____________________________________________________________________________ Stefan Willmeroth is darkness@salyko.doit.sub.org, 8025 Unterhaching, Germany Murphy says: Write a program even idiots can use, and only idiots will want to use it.