<p>I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl:</p>

<pre><code>DrawFrameControl(dc, &amp;rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO);
</code></pre>

<p>I've never been able to figure out a sure fire way to figure out what to pass for the RECT. I've been using a 12x12 rectangle but I'de like Windows to tell me the size of a radio button.</p>

<p>DrawFrameControl seems to scale the radio button to fit the rect I pass so I have to be close to the "right" size of the radio looks off from other (non-owner drawn) radios on the screen.</p>

<p>Anyone know how to do this? </p>

[{'answer_id': 124737, 'author': 'David L Morris', 'author_id': 3137, 'author_profile': 'https://Stackoverflow.com/users/3137', 'pm_score': 2, 'selected': False, 'text': '<p>It has been a while since I worked on this, so what I am describing is what I did, and not necessarily a direct answer to the question.</p>\n\n<p>I happen to use bit maps 13 x 13 rather than 12 x 12.   The bitmap part of the check box seems to be passed in the WM_DRAWITEM.  However, I had also set up WM_MEASUREITEM and fed it the same values, so my answer may well be "Begging the question" in the correct philosophical sense.</p>\n\n<pre>\n        case WM_MEASUREITEM:\n            lpmis = (LPMEASUREITEMSTRUCT) lParam;\n\n            lpmis->itemHeight = 13;\n            lpmis->itemWidth = 13;\n\n            break;\n\n\n        case WM_DRAWITEM:\n            lpdis = (LPDRAWITEMSTRUCT) lParam;\n            hdcMem = CreateCompatibleDC(lpdis->hDC);  \n\n\n\n            if (lpdis->itemState & ODS_CHECKED)  // if selected\n                {\n                SelectObject(hdcMem, hbmChecked);\n                }\n            else\n                {\n                if (lpdis->itemState & ODS_GRAYED)\n                    {\n                    SelectObject(hdcMem, hbmDefault);\n                    }\n                else\n                    {\n                    SelectObject(hdcMem, hbmUnChecked);\n                    }\n                }\n            StretchBlt(\n                lpdis->hDC,         // destination DC\n                lpdis->rcItem.left, // x upper left\n                lpdis->rcItem.top,  // y upper left\n\n                // The next two lines specify the width and\n                // height.\n                lpdis->rcItem.right - lpdis->rcItem.left,\n                lpdis->rcItem.bottom - lpdis->rcItem.top,\n                hdcMem,    // source device context\n                0, 0,      // x and y upper left\n                13,        // source bitmap width\n                13,        // source bitmap height\n                SRCCOPY);  // raster operation\n\n            DeleteDC(hdcMem);\n            return TRUE;\n</pre>\n\n<p>This seems to work well for both Win2000 and XP, though I have nbo idea what Vista might do.</p>\n\n<p>It might be worth an experiment to see what leaving out WM_MEASUREITEM does, though I usually discover with old code that I usually had perfectly good reason for doing something that looks redundant.</p>\n'}, {'answer_id': 124770, 'author': 'Brannon', 'author_id': 5745, 'author_profile': 'https://Stackoverflow.com/users/5745', 'pm_score': 2, 'selected': False, 'text': '<p>This page shows some sizing guidelines for controls.  Note that the sizes are given in both DLU (dialog units) and pixels, depending on whether you are placing the control on a dialog or not:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/aa511279.aspx#controlsizing" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa511279.aspx#controlsizing</a></p>\n\n<p>I thought the <code>GetSystemMetrics</code> API might return the standard size for some of the common controls, but I didn\'t find anything.  There might be a common control specific API to determine sizing.</p>\n'}]
['https://Stackoverflow.com/questions/61739', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3655/']