[comp.windows.ms] Controls in parent window

rkt@bjcong.bj.co.uk (RAKESH TANDON) (10/15/90)

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 ?
                                                   Rakesh.
-- 
Rakesh Kumar Tandon 	            : email   : rkt@bj.co.uk
Boldon James Limited	            : phone   : 0260 280465
Damian House, West Street           : fax     : 0260 298030
CONGLETON, Cheshire                 : UUCP    : ..!mcsun!ukc!pyrltd!bjcong!rkt

al1@pnet51.orb.mn.org (Carl Engman) (10/16/90)

You do not need to place controls on a dialog box, you can place them in the
client area of a parent window. controls are just another type of window with
predefined behavior, and even that you can subclass.


UUCP: {amdahl!bungia, crash}!orbit!pnet51!al1
ARPA: crash!orbit!pnet51!al1@nosc.mil
INET: al1@pnet51.orb.mn.org

darkness@salyko.doit.sub.org (Stefan Willmeroth) (10/19/90)

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.