The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: newAsm on March 12, 2008, 04:13:47 AM

Title: Client window & Group box handle
Post by: newAsm on March 12, 2008, 04:13:47 AM
Hi,

I am wondering which handle I ought to use for controls I placed in a group box in a client window:

1.  Client window handle, handle of the main window or dialog window handle
2.  Group box handle.

When I use client window, and when I want to hide all the controls & the group box using:

invoke  ShowWindow,hGroupBox,SW_HIDE

the controls on the groupbox & the groupbox is still visible. Have I done the right way?

Appreciate some respond. Thanks...GS
Title: Re: Client window & Group box handle
Post by: Tight_Coder_Ex on March 12, 2008, 11:10:41 PM
It sounds like your group box is not a client of the main window therefore changes made there are not reflected on the group box.

Make you group box a child of the client and then all the other controls a child of the group box.  Then when using the groupbox handle to SW_HIDE, it will hide all the child controls too.
Title: Re: Client window & Group box handle
Post by: hutch-- on March 13, 2008, 09:48:33 AM
Hi newAsm,

Welcome on board. keep in mind that unless you have specifically coded a window to fit into the client area that the handle for the main window is the handle you use for its client area. With a group box or any other control for that matter make sure you set the parent window to the handle you want it to stay above, in this instance the main window handle.
Title: Re: Client window & Group box handle
Post by: newAsm on March 15, 2008, 12:51:25 AM
Thanks for your replies (tight_coder_ex & hutch), appreciate that.

I created a dialog box with page control. I applied tight_coder_ex suggestion. However, I need to sub-class the groupbox, because I want to use WM_CHAR to detect the keystrokes. This require additional coding. I have 2 group boxes, and that means I have to sub-class both group boxes.

The "lazy way", is to SW_HIDE & SW_SHOW the controls and group-boxes when I want. Would super-class make both sub-class into one single routine?

Thanks for your suggestions. If I want to contribute the code when I have completed, where/who should I send it to?

..newAsm