Article View: comp.windows.ms.programmer
Article #2360Creating a Button inside a child process
From: dara khani
Date: Mon, 29 Apr 1991 14:04
Date: Mon, 29 Apr 1991 14:04
20 lines
1290 bytes
1290 bytes
I am having a problem with creating a button inside a child process.
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)
I not sure if the order of the parameters are right ( I don't have the program with me).
hWnd is the handle of the child
hInst is the instance of the parent
the handle returned from the CreateWindow is NULL (button not created).
Now, if I put the same CreateWindow in the WM_PAINT part of the procedure
( I know this is wrong) the button is created.
Can someone tell me why this doesn't work in WM_CREATE part and works
in WM_PAINT.
thanks in advance.
DaRa
Technical Details
Message-ID:
<1991Apr29.140448.2027@iplmail.orl.mmc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!everest!iplmail!iplmail!darakShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms.programmer Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!everest!iplmail!iplmail!darak From: darak@iplmail.orl.mmc.com (dara khani) Subject: Creating a Button inside a child process Message-ID: <1991Apr29.140448.2027@iplmail.orl.mmc.com> Sender: darak@iplmail (dara khani) Organization: Martin Marietta Date: Mon, 29 Apr 1991 14:04:48 GMT