WXDWORD msflags = wxWindow::MSWGetStyle
(
(style & ~wxBORDER_MASK) | wxBORDER_NONE, exflags
- ) & ~WS_CHILD;
+ ) & ~WS_CHILD & ~WS_VISIBLE;
// first select the kind of window being created
//
if ( exflags )
{
-#if !defined(__WIN16__) && !defined(__SC__)
+#if !defined(__WIN16__)
if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) )
{
if ( style & wxFRAME_TOOL_WINDOW )
HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */);
if ( !hmenu )
{
- wxLogLastError(_T("GetSystemMenu"));
-
- return FALSE;
+ // no system menu at all -- ok if we want to remove the close button
+ // anyhow, but bad if we want to show it
+ return !enable;
}
// enabling/disabling the close item from it also automatically
bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
{
+ wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
+ _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
+
// The empty region signifies that the shape should be removed from the
// window.
if ( region.IsEmpty() )