News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Client window & Group box handle

Started by newAsm, March 12, 2008, 04:13:47 AM

Previous topic - Next topic

newAsm

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

Tight_Coder_Ex

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.

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

newAsm

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