Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!ira.uka.de!unido!rwthinf!slcdec!hippo!f1.n6000.z2.fidonet.org!p4.f36.n245.z2.fidonet.org!Norbert_Unterberg From: Norbert_Unterberg@p4.f36.n245.z2.fidonet.org (Norbert Unterberg) Newsgroups: comp.windows.ms.programmer Subject: Creating a Button inside a child process Message-ID: <1368046960@p4.f36.n245.z2.fidonet.org> Date: 3 May 91 09:46:00 GMT References: <5332@p1.f6.n242.z2.fidonet.org> Reply-To: Norbert_Unterberg%p4.f36.n245.z2@hippo.dfv.rwth-aachen.de (Norbert Unterberg) Organization: Point of SoftStream, Dortmund, Germany Lines: 18 Comment-To: dara_khani@f1.n6000.z2.fidonet.org (Dara Khani) > From: darak@iplmail.orl.mmc.com (dara khani) > > > I have a parent window which create a child process (a window). > In the child process procedure I have a WM_CREATE case which calls > the CreateWindow function to create a button: > CreateWindow("button", "hi", WS_CHILD | WS_VISIBLE | WS_PUSHBUTTON, > 1,1, 30,30, hWnd, 1, hInst, NULL) > > Can someone tell me why this doesn't work in WM_CREATE part and works > in WM_PAINT. Maybe the hInst is not yet valid, because you do a hInst = hInstance; in WinMain() after the CreateWindow() call for the child? Gruss Norbert