+#ifdef __WIN32__
+ // calling CheckMenuRadioItem() with such parameters hangs my system
+ // (NT4 SP6) and I suspect this could happen to the others as well - so
+ // don't do it!
+ wxCHECK_RET( start != -1 && end != -1,
+ _T("invalid ::CheckMenuRadioItem() parameter(s)") );
+
+ if ( !::CheckMenuRadioItem(hmenu,
+ start, // the first radio group item
+ end, // the last one
+ pos, // the one to check
+ MF_BYPOSITION) )
+ {
+ wxLogLastError(_T("CheckMenuRadioItem"));
+ }
+#endif // __WIN32__
+
+ // also uncheck all the other items in this radio group
+ wxMenuItemList::compatibility_iterator node = items.Item(start);
+ for ( int n = start; n <= end && node; n++ )
+ {
+ if ( n != pos )
+ {
+ node->GetData()->m_isChecked = FALSE;
+ }
+
+ // we also have to do it in the menu for Win16 (under Win32
+ // CheckMenuRadioItem() does it for us)
+#ifndef __WIN32__
+ ::CheckMenuItem(hmenu, n, n == pos ? MF_CHECKED : MF_UNCHECKED);
+#endif // Win16
+
+ node = node->GetNext();
+ }
+ }
+ else // check item
+ {
+ if ( ::CheckMenuItem(hmenu,
+ GetRealId(),
+ MF_BYCOMMAND | flags) == (DWORD)-1 )
+ {
+ wxLogLastError(wxT("CheckMenuItem"));
+ }