Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think WM_NCHHITTEST/HT_TRANSPARENT is indeed the key here.</p> <p>Group boxes are an odd sort of control: while it looks like they contain other controls, they are actually siblings of those controls in the HWND tree. So a groupbox that looks like it contains two buttons is actually a sibling of those buttons - and could come before or after it in the HWND hierarchy.</p> <p>Group boxes respond to WM_NCHITTEST with HT_TRANSPARENT, so that mouse clicks go right through them. One benefit of this is that it doesn't matter whether the group box comes before or after the controls that it appears to contain in the window order; the clicks will end up being routed to those controls, not the groupbox.</p> <p>To get double-clicking (or just plain clicking) on the groupbox to work, you'd need to do two things:</p> <ul> <li>override the default WM_NCHITTEST behavior and instead return HT_CLIENT, like a regular control</li>; at this point it should be capable of getting WM_LBUTTONDOWN and related events that would otherwise have gone elsewhere (to a sibling, or to the dialog itself). <li>ensure that the contents of the groupbox come *before* it in the HWND z-order, so that they are no longer relying on clicks going 'through' the groupbox. (At least I think you want them to be before; either way, you may need to play with the HWND ordering now that it's significant again.) </ul> <p>Note that this is a different type of transparency again from the WS_EX_TRANSPARENT, which might be what the Transparent class wizard property maps to. Grossly simplified, HT_TRANSPARENT has to do with being transparent to the mouse; WS_EX_TRANSPARENT is more about being painted last so that siblings "show through".</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload