title: Windows Common Control Bug?
body: <p>Recently I have faced with very strange behavior of the Windows "Button" control having BS_MULTILINE style, which looks like bug in Windows. To reproduce it, make the following:  </p>
  
  <p>(1) Create new project with Visual Studio 2012 Project Wizard; choose "MFC application";<br>
  (2) On "Application Type" page choose "Dialog based" + "MFC standard";<br>
  (3) On "Advanced Features" page keep only "Common Control Manifest";<br>
  (4) In the generated "Resource.h" file add the line <code>#define IDC_LONG_TEXT    103</code>;<br>
  (5) In the generated &lt;project-name&gt;.rc file replace "TODO" static text inside the main dialog definition by the lines:</p>
  
  <pre><code>LTEXT       "BUG IN WINDOWS COMMON CONTROLS.\nButton containing image and text does not work with BS_MULTILINE style.",IDC_STATIC,10,10,250,20
  PUSHBUTTON  "Very Long Text.",IDC_LONG_TEXT,10,35,250,45,BS_LEFT | BS_TOP | BS_MULTILINE | BS_FLAT
  </code></pre>
  
  <p>(6) In the generated &lt;project-name&gt;Dlg.cpp file, in the <code>OnInitDialog()</code> handler, add the following code after "TODO" comment line:</p>
  
  <pre><code>CString strOrigText, strLongText;
  CWnd* pButton = GetDlgItem(IDC_LONG_TEXT);
  pButton-&gt;GetWindowText(strOrigText);
  for (int i = 0; i &lt; 10; ++i)
      strLongText += strOrigText;
  pButton-&gt;SetWindowText(strLongText);
  pButton-&gt;SendMessage(BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)m_hIcon);
  </code></pre>
  
  <p>(7) Build and run the program. You will see that the button text is drawn in the upper-right corner of the button. If you comment the last line in the above code, the text will be drawn correctly.  </p>
  
  <p>Does anybody faced with the same problem? Is it really a bug? If so, how it can be submitted to Microsoft?</p>