+ //
+ // The default parent set for the Statusbar is m_hWnd which, of course,
+ // is the handle to the client window of the frame. We don't want that,
+ // so we have to set the parent to actually be the Frame.
+ //
+ hWnd = pStatusBar->GetHWND();
+ if (!::WinSetParent(hWnd, GetHWND(), FALSE))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error setting parent for statusbar. Error: %s\n", sError);
+ return NULL;
+ }
+
+ //
+ // Also we need to reset it positioning to enable the SHOW attribute
+ //
+ if (!::WinQueryWindowPos((HWND)pStatusBar->GetHWND(), &vSwp))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error querying frame for statusbar position. Error: %s\n", sError);
+ return NULL;
+ }
+ if (!::WinSetWindowPos( (HWND)pStatusBar->GetHWND()
+ ,HWND_TOP
+ ,vSwp.cx
+ ,vSwp.cy
+ ,vSwp.x
+ ,vSwp.y
+ ,SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_ZORDER
+ ))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error setting statusbar position. Error: %s\n", sError);
+ return NULL;
+ }