Discussion:
BS_AUTORADIOBUTTON - how to iterate thru a set of them ?
(too old to reply)
R.Wieser
2019-02-10 21:48:25 UTC
Permalink
Hello all,

Does anyone know how to *iterate* thru a group of auto radio buttons, to see
which one is selected / change their selected status ?

Currently I'm using GetWindow with the GW_HWNDNEXT argument, but need to do
some hacky and rather non-perfect checks (using the class atom as well as
the button type bits (lower 4) ) to stay within the group - in effect trying
to emulate the group behaviour the auto radio buttons already have.

But I would not be amazed if this has already been solved before in a much
more elegant way. :-)

Regards,
Rudy Wieser
JJ
2019-02-11 14:48:19 UTC
Permalink
Post by R.Wieser
Hello all,
Does anyone know how to *iterate* thru a group of auto radio buttons, to see
which one is selected / change their selected status ?
Currently I'm using GetWindow with the GW_HWNDNEXT argument, but need to do
some hacky and rather non-perfect checks (using the class atom as well as
the button type bits (lower 4) ) to stay within the group - in effect trying
to emulate the group behaviour the auto radio buttons already have.
But I would not be amazed if this has already been solved before in a much
more elegant way. :-)
Regards,
Rudy Wieser
GetNextDlgGroupItem(). Assuming that the radio controls are on a standard
dialog window. Otherwise, grouped controls' ID or window handle needs to be
manually kept in an array (i.e. one array for each group), then use a loop
to iterate through it.
R.Wieser
2019-02-12 17:58:52 UTC
Permalink
This post might be inappropriate. Click to display it.
JJ
2019-02-13 12:08:04 UTC
Permalink
This post might be inappropriate. Click to display it.
R.Wieser
2019-02-13 12:36:44 UTC
Permalink
JJ,
Post by JJ
But that is what it is designed for. Control type is irrelevant.
Than we have a misunderstanding: I need to iterate /specific/ controls. In
my current case the BUTTON class and of the BS_AUTORADIOBUTTON kind.

For that GetNextDlgGroupItem doesn't seem to be any better than GetWindow
(worse actually, as the latter will simply run outof controls (which is easy
to check), while the former will "wrap around")
Post by JJ
It's actually useful.
I doubt it, for the already mentioned reason.

Regards,
Rudy Wieser

Loading...