Microsoft KB Archive/261192

{|
 * width="100%"|

BUG: Radio Button with BS_AUTORADIOBUTTON Style Enters Endless Loop

 * }

Q261192

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)

-

SYMPTOMS
If a button with the BS_AUTORADIOBUTTON style is clicked and is followed in the tab order by a child dialog box, it enters an endless loop.

This endless loop can also be entered if the radio button is hidden and enabled, no other control has the WS_GROUP style, and the radio button's keyboard shortcut is pressed.

CAUSE
When a button with the BS_AUTORADIOBUTTON style releases capture, it enters into a loop, turning off all other radio buttons in its group. The button does this by searching for the next control with the WS_GROUP style (by using the GetNextDlgGroupItem function), in a loop, until it comes back to itself. When this radio button is followed in the tab order by a child dialog box, GetNextDlgGroupItem enters the child dialog box and returns the handle to a control in this dialog box. In the next iteration of the loop, GetNextDlgGroupItem returns the parent of the control, which is the handle to the child dialog box. This action causes GetNextDlgGroupItem to return handles to its child windows and it cannot come out of the child dialog box.

RESOLUTION
A different control with the WS_GROUP style must be placed after the radio buttons to prevent GetNextDlgGroupItem from entering the child dialog box.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Additional query words:

Keywords : kbOSWinNT kbOSWin2000 kbOSWin95 kbOSWin98 kbDSupport

Issue type : kbbug

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch