CreateWindowEx and WS_ style constants

CreateWindowEx and WS_ style constants

Post by mike.ra » Thu, 05 Aug 2004 16:37:12


Hello Guys and girls.

I'm new to C under Windows, I'm normally a Unix prorgrammer.

I've started using lcc to write some simple Windows MDI stuff and I've
been having trouble getting WS_ constants to make ANY difference when
I use CreateWindowEx to create an MDI child window, the class of which
I have previously regiestered with RegisterClassEx.

I've started off by using the wizard generated code but it seems
whatever I do the child windows appear with a caption bar and min, max
and close boxes.

Can't paste the code hre because I'm at work but here's the sequence
(not including creating the MDI window and client):

1 Register a class with RegiesterClassEx
2 Create a window with CreateWindowEx specifying the MDIClient
window as the parent

Are there any know problems with lcc and creating MDI child windows
like this?

Thanks.

Mike
 
 
 

CreateWindowEx and WS_ style constants

Post by John » Thu, 05 Aug 2004 19:12:25

> Hello Guys and girls.

The trick is to make the client window with MDIS_ALLCHILDSTYLES, then the
MDI child window can be made as you require. Here are examples;

// Create the MDI client
hWndClient = CreateWindowEx(WS_EX_LEFT | WS_EX_LTRREADING |
WS_EX_RIGHTSCROLLBAR | WS_EX_CLIENTEDGE,
"MDICLIENT", NULL,
WS_OVERLAPPED | WS_CHILD | MDIS_ALLCHILDSTYLES |
WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
0, 0, 0, 0,
hWndparent,
(HMENU)NULL,
hInst,
(LPVOID)&ccs);

// Create the MDI child
hWndChild = CreateWindowEx(WS_EX_MDICHILD | WS_EX_CLIENTEDGE,
"MdiChildWndClass", strTitle,
WS_OVERLAPPED | WS_VISIBLE | WS_CAPTION,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
g_hWndClient, NULL, g_hInst, 0);

John

 
 
 

CreateWindowEx and WS_ style constants

Post by mike.ra » Fri, 06 Aug 2004 00:26:01


That's great John, thanks.

I found MDIS_ALLCHILDSTYLES about ten minutes ago but have not had
chance to try it yet so your examples are very useful.

Mike