]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toplevel.cpp
WinCE doesn't have GetMessageTime
[wxWidgets.git] / src / msw / toplevel.cpp
index 1c26f2e5e6419ca19d704b8b3546c8b1f0335956..6874f1327da7bfcd48bebf794c065c4f8b7ab4cb 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevel.h"
 #endif
 
@@ -43,7 +43,9 @@
 #include "wx/msw/private.h"
 #include "wx/msw/winundef.h"
 
-#ifdef CreateDialog
+// This can't be undefed in winundef.h or
+// there are further errors
+#if defined(__WXWINCE__) && defined(CreateDialog)
 #undef CreateDialog
 #endif
 
@@ -170,6 +172,8 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const
         msflags |= WS_THICKFRAME;
 #endif
     }
+    else if ( exflags && ((style & wxBORDER_DOUBLE) || (style & wxBORDER_RAISED)) )
+        *exflags |= WS_EX_DLGMODALFRAME;
     else if ( !(style & wxBORDER_NONE) )
         msflags |= WS_BORDER;
 #ifndef __WXWINCE__
@@ -211,13 +215,16 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const
 
     if ( exflags )
     {
-#if !defined(__WIN16__) 
+#if !defined(__WIN16__)
         if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) )
         {
             if ( style & wxFRAME_TOOL_WINDOW )
             {
                 // create the palette-like window
                 *exflags |= WS_EX_TOOLWINDOW;
+
+                // tool windows shouldn't appear on the taskbar (as documented)
+                style |= wxFRAME_NO_TASKBAR;
             }
 
             // We have to solve 2 different problems here:
@@ -345,10 +352,12 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
     if ( exflags )
     {
         ::SetWindowLong(GetHwnd(), GWL_EXSTYLE, exflags);
-        ::SetWindowPos(GetHwnd(), NULL, 0, 0, 0, 0,
+        ::SetWindowPos(GetHwnd(),
+                       exflags & WS_EX_TOPMOST ? HWND_TOPMOST : 0,
+                       0, 0, 0, 0,
                        SWP_NOSIZE |
                        SWP_NOMOVE |
-                       SWP_NOZORDER |
+                       (exflags & WS_EX_TOPMOST ? 0 : SWP_NOZORDER) |
                        SWP_NOACTIVATE);
     }