That question has already been answered in your thread at MSDN.
For an idea about drawing non themed buttons refer to http://blog.quppa.net/2012/02/12/drawing-non-themed-push-buttons-in-windows/ Read More
If you specify BS_OWNERDRAW then you shouldn't combine any other button styles with it.
I couldn't reproduce your problem with WM_COMMAND using VS 2012, though I did change the code to SetWindowText(hwnd, "hi");
yes.. you have right... the SetWindowText() don't works with hButton when i use BS_OWNERDRAW style.
for finish these topic, let me ask anotherthing: when i draw the button face(the WM_DRAWITEM message), why i get the windows XP visual style instead windows 98\2000 visual style?
the OpenThemeData() function is the problem?
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...