Re: Create a WS_CHILD window in another thread with its own WinProc
- From: Norman Bullen <norm@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 20 Feb 2007 00:04:39 GMT
docschnipp wrote:
Hi,You are putting _window style_ values (WS_CHILD and WS_VISIBLE) in a WNDCLASS element which should get only _class style_ values.
for a specific reason I want to have a parent window (with a menu bar etc.) and in that a child window. The Child Window is created in a worker thread and uses its own WinProc to receive messages etc.
This works as long I don't use the WS_CHILD style. In this case, a second window opens and is working independently.
But I want to run it inside the other window (like a control).
In this case, when using the WS_CHILD style, I can not register the Class, GetLastError() returns 87 (invalid parameter).
The code for the second window class looks as follows:
mWindowClass.cbSize = sizeof(mWindowClass);
mWindowClass.style = CS_HREDRAW | CS_VREDRAW;
if ( hSystemWindow ) // this means a parent window is defined
{
mWindowClass.style = WS_CHILD | WS_VISIBLE ;
}
mWindowClass.lpfnWndProc = OtherWndProc;
mWindowClass.cbClsExtra = 0;
mWindowClass.cbWndExtra = 0;
mWindowClass.hInstance = (HINSTANCE) hInstance;
mWindowClass.hIcon = LoadIcon(mWindowClass.hInstance,IDI_APPLICATION);
mWindowClass.hCursor = LoadCursor(NULL, IDC_ARROW); // predefined arrow mWindowClass.hbrBackground = (HBRUSH) GetStockObject( WHITE_BRUSH);
mWindowClass.lpszClassName = "innerpanel";
mWindowClass.lpszMenuName = 0;
mWindowClass.hIconSm = 0;
hwndClass = RegisterClassEx(&mWindowClass);
Any hint what I am doing wrong?
thanks
doc
Use WS_CHILD and WS_VISIBLE when you call CreateWindow().
Norm
--
--
To reply, change domain to an adult feline.
.
- Prev by Date: Re: SPY++ very slow on 64-bit
- Next by Date: strange behaviour WS_VISIBLE, propertypage, disabled controls
- Previous by thread: RE: Binding to ExtendedProperties or properties of a strongly typed da
- Next by thread: Re: Create a WS_CHILD window in another thread with its own WinPro
- Index(es):
Relevant Pages
|