- if (m_acceleratorTable != 0 &&
- ::TranslateAccelerator((HWND) GetHWND(), (HANDLE) m_acceleratorTable, (MSG *)pMsg))
- return TRUE;
-
- return FALSE;
+ RECT rect;
+ if ( GetUpdateRect(GetHwnd(), &rect, FALSE) )
+ {
+#ifndef __WXMICROWIN__
+ if ( m_iconized )
+ {
+ HICON hIcon = m_icon.Ok() ? GetHiconOf(m_icon)
+ : (HICON)m_defaultIcon;
+
+ // Hold a pointer to the dc so long as the OnPaint() message
+ // is being processed
+ PAINTSTRUCT ps;
+ HDC hdc = ::BeginPaint(GetHwnd(), &ps);
+
+ // Erase background before painting or we get white background
+ MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
+
+ if ( hIcon )
+ {
+ RECT rect;
+ ::GetClientRect(GetHwnd(), &rect);
+
+ // FIXME: why hardcoded?
+ static const int icon_width = 32;
+ static const int icon_height = 32;
+
+ int icon_x = (int)((rect.right - icon_width)/2);
+ int icon_y = (int)((rect.bottom - icon_height)/2);
+
+ ::DrawIcon(hdc, icon_x, icon_y, hIcon);
+ }
+
+ ::EndPaint(GetHwnd(), &ps);
+
+ return TRUE;
+ }
+ else
+ #endif
+ {
+ return wxWindow::HandlePaint();
+ }
+ }
+ else
+ {
+ // nothing to paint - processed
+ return TRUE;
+ }