#pragma hdrstop
 #endif
 
-#if wxUSE_CHOICE && !defined(__SMARTPHONE__)
+#if wxUSE_CHOICE && !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
 
 #ifndef WX_PRECOMP
     #include "wx/choice.h"
     return (WXHBRUSH)brush->GetResourceHandle();
 }
 
-#endif // wxUSE_CHOICE && !__SMARTPHONE__
+#endif // wxUSE_CHOICE && !(__SMARTPHONE__ && __WXWINCE__)
 
     #include "wx/msgdlg.h"
 #endif
 
-#if wxUSE_COLOURDLG && !defined(__SMARTPHONE__)
+#if wxUSE_COLOURDLG && !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
 
 #include "wx/msw/private.h"
 #include "wx/colordlg.h"
         *height = 299;
 }
 
-#endif
+#endif // wxUSE_COLOURDLG && !(__SMARTPHONE__ && __WXWINCE__)
 
 {
     // take size according to layout
     wxSize bestSize(
-#ifdef __SMARTPHONE__
+#ifdef defined(__SMARTPHONE__) && defined(__WXWINCE__)
                     0,GetCharHeight()
-#else // !__SMARTPHONE__
+#else
                     GetSystemMetrics(is_vertical ? SM_CXVSCROLL : SM_CXHSCROLL),
                     GetSystemMetrics(is_vertical ? SM_CYVSCROLL : SM_CYHSCROLL)
-#endif // __SMARTPHONE__/!__SMARTPHONE__
+#endif
     );
 
     // correct size as for undocumented MSW variants cases (WinCE and perhaps others)
 
     #include <commdlg.h>
 #endif
 
-#ifdef __SMARTPHONE__
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
     #include "wx/msw/wince/resources.h"
-#endif // __SMARTPHONE__
+#endif // __SMARTPHONE__ && __WXWINCE__
 
 // ----------------------------------------------------------------------------
 // wxWin macros
 
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
 
-#ifdef __SMARTPHONE__
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
     SetLeftMenu(wxID_OK, _("OK"));
 #endif
 
 
     #pragma hdrstop
 #endif
 
-#if wxUSE_DIRDLG && !defined(__SMARTPHONE__)
+#if wxUSE_DIRDLG && !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
 
 #if defined(__WIN95__) && !defined(__GNUWIN32_OLD__) && wxUSE_OLE
 
     #include "../generic/dirdlgg.cpp"
 #endif // compiler/platform on which the code here compiles
 
-#endif // wxUSE_DIRDLG && !defined(__SMARTPHONE__)
+#endif // wxUSE_DIRDLG && !(__SMARTPHONE__ && __WXWINCE__)
 
     #pragma hdrstop
 #endif
 
-#if wxUSE_FILEDLG && !defined(__SMARTPHONE__)
+#if wxUSE_FILEDLG && !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
 
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
 
 }
 
-#endif // wxUSE_FILEDLG
+#endif // wxUSE_FILEDLG && !(__SMARTPHONE__ && __WXWINCE__)
 
 
 
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
 
-#ifdef __SMARTPHONE__
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
     SetLeftMenu(wxID_EXIT, _("Done"));
 #endif
 
 
 void wxFrame::AttachMenuBar(wxMenuBar *menubar)
 {
-#if defined(__SMARTPHONE__)
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
 
     wxMenu *autoMenu = NULL;
 
         }
 #endif // wxUSE_MENUS_NATIVE
 
-#ifdef __SMARTPHONE__
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
         // handle here commands from Smartphone menu bar
         if ( wxTopLevelWindow::HandleCommand(id, cmd, control ) )
         {
             return true;
         }
-#endif // __SMARTPHONE__
+#endif // __SMARTPHONE__ && __WXWINCE__
 
         if ( ProcessCommand(id) )
         {
 
     unsigned int msStyle = MB_OK;
     if (m_dialogStyle & wxYES_NO)
     {
-#if !defined(__SMARTPHONE__)
+#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
         if (m_dialogStyle & wxCANCEL)
             msStyle = MB_YESNOCANCEL;
         else
-#endif // __SMARTPHONE__
+#endif // !(__SMARTPHONE__ && __WXWINCE__)
             msStyle = MB_YESNO;
 
         if (m_dialogStyle & wxNO_DEFAULT)
 
     #pragma hdrstop
 #endif
 
-#if wxUSE_TEXTCTRL && !defined(__SMARTPHONE__)
+#if wxUSE_TEXTCTRL && !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
 
 #ifndef WX_PRECOMP
     #include "wx/textctrl.h"
 
 #endif // wxUSE_RICHEDIT
 
-#endif // wxUSE_TEXTCTRL && !__SMARTPHONE__
+#endif // wxUSE_TEXTCTRL && !(__SMARTPHONE__ && __WXWINCE__)
 
 
     m_winLastFocused = (wxWindow *)NULL;
 
-#ifdef __SMARTPHONE__
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
     m_MenuBarHWND = 0;
 #endif
 }
     }
     //else: WS_OVERLAPPED is 0 anyhow, so it is on by default
 
-#ifndef __SMARTPHONE__
+#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
     // border and caption styles
     if ( style & wxRESIZE_BORDER )
         msflags |= WS_THICKFRAME;
     }
 #endif
 
-#ifdef __SMARTPHONE__
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
     SetRightMenu(); // to nothing for initialization
 #endif