I have a parent window and a few child windows attached to this. With SpyXX I can see the children all have a certain style class, lets say ChildWindowClass
.
When I create the window with the name of this particular class, CreateWindowEx
returns a NULL
handle. If I use my own class and just set the parent, the window is a child window, but - of course - has a different class as all the other children.
If I get me the style and then set it, the style is found, but not set for my child window. It still shows the style used with CreateWindowEx
HWND firstChild = FindWindowEx(MyClass::_parent, NULL, szFsxChildWindowClass, NULL);
LONG childStyle = GetWindowLong(firstChild, GWL_STYLE);
...
SetWindowLong(MyClass::_child,GWL_STYLE, childStyle);
The ChildWindowClass
is not registered by me, so I can not crosscheck how it is registered. So how can I set this style for my child window?
-- Edit call as requested --
child = CreateWindowEx( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR,
szWindowClass, // this is where I want to place the name of the child class
_T("Test"),
WS_CHILDWINDOW | WS_VISIBLE,
x,y, // 0,0
w, h, // 500,100
MyClass::_parent, // parent
NULL,
MyClass::_hInstance, // must this be 0??
NULL
);