From 3b97482dbc24b15835297703490f2d996ed96473 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 02:05:32 +0200 Subject: [PATCH 01/30] Remove wxFileDialog related symbols already present since Win2k --- src/msw/filedlg.cpp | 79 ++++----------------------------------------- 1 file changed, 6 insertions(+), 73 deletions(-) diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 1c16505ce5..07a9932796 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -370,63 +370,11 @@ static bool DoShowCommFileDialog(OPENFILENAME *of, long style, DWORD *err) return false; } -// We want to use OPENFILENAME struct version 5 (Windows 2000/XP) but we don't -// know if the OPENFILENAME declared in the currently used headers is a V5 or -// V4 (smaller) one so we try to manually extend the struct in case it is the -// old one. -// -// We don't do this under Win64, however, as there are no -// compilers with old headers for these architectures -#if defined(__WIN64__) - typedef OPENFILENAME wxOPENFILENAME; - - static const DWORD gs_ofStructSize = sizeof(OPENFILENAME); -#else // __WIN64__ - #define wxTRY_SMALLER_OPENFILENAME - - struct wxOPENFILENAME : public OPENFILENAME - { - // fields added in Windows 2000/XP comdlg32.dll version - void *pVoid; - DWORD dw1; - DWORD dw2; - }; - - // hardcoded sizeof(OPENFILENAME) in the Platform SDK: we have to do it - // because sizeof(OPENFILENAME) in the headers we use when compiling the - // library could be less if _WIN32_WINNT is not >= 0x500 - static const DWORD wxOPENFILENAME_V5_SIZE = 88; - - // this is hardcoded sizeof(OPENFILENAME_NT4) from Platform SDK - static const DWORD wxOPENFILENAME_V4_SIZE = 76; - - // always try the new one first - static DWORD gs_ofStructSize = wxOPENFILENAME_V5_SIZE; -#endif // __WIN64__/!... - static bool ShowCommFileDialog(OPENFILENAME *of, long style) { DWORD errCode; bool success = DoShowCommFileDialog(of, style, &errCode); -#ifdef wxTRY_SMALLER_OPENFILENAME - // the system might be too old to support the new version file dialog - // boxes, try with the old size - if ( !success && errCode == CDERR_STRUCTSIZE && - of->lStructSize != wxOPENFILENAME_V4_SIZE ) - { - of->lStructSize = wxOPENFILENAME_V4_SIZE; - - success = DoShowCommFileDialog(of, style, &errCode); - - if ( success || !errCode ) - { - // use this struct size for subsequent dialogs - gs_ofStructSize = of->lStructSize; - } - } -#endif // wxTRY_SMALLER_OPENFILENAME - if ( !success && errCode == FNERR_INVALIDFILENAME && of->lpstrFile[0] ) @@ -517,10 +465,10 @@ int wxFileDialog::ShowModal() msw_flags |= OFN_OVERWRITEPROMPT; } - wxOPENFILENAME of; + OPENFILENAME of; wxZeroMemory(of); - of.lStructSize = gs_ofStructSize; + of.lStructSize = sizeof(OPENFILENAME); of.hwndOwner = hWndParent; of.lpstrTitle = m_message.t_str(); of.lpstrFileTitle = titleBuffer; @@ -666,11 +614,10 @@ int wxFileDialog::ShowModal() } } cwdOrig; - // GetOpenFileName will always change the current working directory on - // (according to MSDN) "Windows NT 4.0/2000/XP" because the flag - // OFN_NOCHANGEDIR has no effect. If the user did not specify - // wxFD_CHANGE_DIR let's restore the current working directory to what it - // was before the dialog was shown. + // GetOpenFileName will always change the current working directory + // (according to MSDN) because the flag OFN_NOCHANGEDIR has no effect. + // If the user did not specify wxFD_CHANGE_DIR let's restore the + // current working directory to what it was before the dialog was shown. if (msw_flags & OFN_NOCHANGEDIR) cwdOrig.value = wxGetCwd(); @@ -682,14 +629,9 @@ int wxFileDialog::ShowModal() m_fileNames.Empty(); if ( ( HasFdFlag(wxFD_MULTIPLE) ) && -#if defined(OFN_EXPLORER) ( fileNameBuffer[of.nFileOffset-1] == wxT('\0') ) -#else - ( fileNameBuffer[of.nFileOffset-1] == wxT(' ') ) -#endif // OFN_EXPLORER ) { -#if defined(OFN_EXPLORER) m_dir = fileNameBuffer; i = of.nFileOffset; m_fileName = &fileNameBuffer[i]; @@ -701,15 +643,6 @@ int wxFileDialog::ShowModal() m_fileNames.Add(&fileNameBuffer[i]); i += wxStrlen(&fileNameBuffer[i]) + 1; } -#else - wxStringTokenizer toke(fileNameBuffer, wxT(" \t\r\n")); - m_dir = toke.GetNextToken(); - m_fileName = toke.GetNextToken(); - m_fileNames.Add(m_fileName); - - while (toke.HasMoreTokens()) - m_fileNames.Add(toke.GetNextToken()); -#endif // OFN_EXPLORER m_path = m_dir; if ( m_dir.Last() != wxT('\\') ) From e21c82f2fec23203c84c356bead1fe18a9448a28 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 03:03:11 +0200 Subject: [PATCH 02/30] Remove check for DTS_SHORTDATECENTURYFORMAT --- src/msw/datectrl.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index d21cb60ef0..a7d20ac984 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -74,11 +74,9 @@ WXDWORD wxDatePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const styleMSW |= DTS_UPDOWN; //else: drop down by default -#ifdef DTS_SHORTDATECENTURYFORMAT if ( style & wxDP_SHOWCENTURY ) styleMSW |= DTS_SHORTDATECENTURYFORMAT; else -#endif // DTS_SHORTDATECENTURYFORMAT styleMSW |= DTS_SHORTDATEFORMAT; if ( style & wxDP_ALLOWNONE ) From eb1d11607c1b1865049c69fdaa97d7ebc1af7a79 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 03:04:51 +0200 Subject: [PATCH 03/30] Remove check for BFFM_SETSELECTION --- src/msw/dirdlg.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index a2bffb09ba..092d9ef8d4 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -459,7 +459,6 @@ BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) { switch(uMsg) { -#ifdef BFFM_SETSELECTION case BFFM_INITIALIZED: // sent immediately after initialisation and so we may set the // initial selection here @@ -467,8 +466,6 @@ BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) // wParam = TRUE => lParam is a string and not a PIDL ::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData); break; -#endif // BFFM_SETSELECTION - case BFFM_SELCHANGED: // note that this doesn't work with the new style UI (MSDN doesn't From 66d48500c5e13d48a0d056c32a50999774bc12e4 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 03:07:21 +0200 Subject: [PATCH 04/30] Remove checks for SM_XXX system metrics symbols. --- src/msw/settings.cpp | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp index 55cf5c6cea..db3bb41560 100644 --- a/src/msw/settings.cpp +++ b/src/msw/settings.cpp @@ -223,83 +223,41 @@ static const int gs_metricsMap[] = SM_CXBORDER, SM_CYBORDER, -#ifdef SM_CXCURSOR SM_CXCURSOR, SM_CYCURSOR, -#else - -1, -1, -#endif SM_CXDOUBLECLK, SM_CYDOUBLECLK, -#if defined(SM_CXDRAG) SM_CXDRAG, SM_CYDRAG, SM_CXEDGE, SM_CYEDGE, -#else - -1, -1, -1, -1, -#endif SM_CXHSCROLL, SM_CYHSCROLL, -#ifdef SM_CXHTHUMB SM_CXHTHUMB, -#else - -1, -#endif SM_CXICON, SM_CYICON, SM_CXICONSPACING, SM_CYICONSPACING, -#ifdef SM_CXHTHUMB SM_CXMIN, SM_CYMIN, -#else - -1, -1, -#endif SM_CXSCREEN, SM_CYSCREEN, -#if defined(SM_CXSIZEFRAME) SM_CXSIZEFRAME, SM_CYSIZEFRAME, SM_CXSMICON, SM_CYSMICON, -#else - -1, -1, -1, -1, -#endif SM_CYHSCROLL, SM_CXHSCROLL, SM_CXVSCROLL, SM_CYVSCROLL, -#ifdef SM_CYVTHUMB SM_CYVTHUMB, -#else - -1, -#endif SM_CYCAPTION, SM_CYMENU, -#if defined(SM_NETWORK) SM_NETWORK, -#else - -1, -#endif -#ifdef SM_PENWINDOWS SM_PENWINDOWS, -#else - -1, -#endif -#if defined(SM_SHOWSOUNDS) SM_SHOWSOUNDS, -#else - -1, -#endif - // SM_SWAPBUTTON is not available under CE and it doesn't make sense to ask - // for it there -#ifdef SM_SWAPBUTTON SM_SWAPBUTTON, -#else - -1, -#endif -1 // wxSYS_DCLICK_MSEC - not available as system metric }; From 8d387fafe5e0a57dd33ab796d58ef796bbbff22a Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 03:12:14 +0200 Subject: [PATCH 05/30] Remove checks for MM_JOY1MOVE, VK_APPS, ENDSESSION_LOGOFF, PBT_APMRESUMEAUTOMATIC, JOY_BUTTON1, SM_SWAPBUTTON. --- src/msw/window.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 7534a69cb0..8f426d89ca 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2933,7 +2933,6 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, } break; -#ifdef MM_JOY1MOVE case MM_JOY1MOVE: case MM_JOY2MOVE: case MM_JOY1ZMOVE: @@ -2947,7 +2946,6 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, HIWORD(lParam), wParam); break; -#endif // MM_JOY1MOVE case WM_COMMAND: { @@ -3064,13 +3062,11 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, case VK_OEM_PERIOD: break; -#ifdef VK_APPS // special case of VK_APPS: treat it the same as right mouse // click because both usually pop up a context menu case VK_APPS: processed = HandleMouseEvent(WM_RBUTTONDOWN, -1, -1, 0); break; -#endif // VK_APPS default: if ( (wParam >= '0' && wParam <= '9') || @@ -3107,14 +3103,12 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, case WM_SYSKEYUP: case WM_KEYUP: -#ifdef VK_APPS // special case of VK_APPS: treat it the same as right mouse button if ( wParam == VK_APPS ) { processed = HandleMouseEvent(WM_RBUTTONUP, -1, -1, 0); } else -#endif // VK_APPS { processed = HandleKeyUp((WORD) wParam, lParam); } @@ -3864,7 +3858,6 @@ bool wxWindowMSW::MSWOnNotify(int WXUNUSED(idCtrl), bool wxWindowMSW::HandleQueryEndSession(long logOff, bool *mayEnd) { -#ifdef ENDSESSION_LOGOFF wxCloseEvent event(wxEVT_QUERY_END_SESSION, wxID_ANY); event.SetEventObject(wxTheApp); event.SetCanVeto(true); @@ -3880,16 +3873,10 @@ bool wxWindowMSW::HandleQueryEndSession(long logOff, bool *mayEnd) } return rc; -#else - wxUnusedVar(logOff); - wxUnusedVar(mayEnd); - return false; -#endif } bool wxWindowMSW::HandleEndSession(bool endSession, long logOff) { -#ifdef ENDSESSION_LOGOFF // do nothing if the session isn't ending if ( !endSession ) return false; @@ -3904,11 +3891,6 @@ bool wxWindowMSW::HandleEndSession(bool endSession, long logOff) event.SetLoggingOff((logOff & ENDSESSION_LOGOFF) != 0); return wxTheApp->ProcessEvent(event); -#else - wxUnusedVar(endSession); - wxUnusedVar(logOff); - return false; -#endif } // --------------------------------------------------------------------------- @@ -4222,9 +4204,7 @@ bool wxWindowMSW::HandlePower(WXWPARAM wParam, case PBT_APMPOWERSTATUSCHANGE: case PBT_APMOEMEVENT: case PBT_APMRESUMECRITICAL: -#ifdef PBT_APMRESUMEAUTOMATIC case PBT_APMRESUMEAUTOMATIC: -#endif evtType = wxEVT_NULL; break; } @@ -5757,7 +5737,6 @@ bool wxWindowMSW::HandleClipboardEvent(WXUINT nMsg) bool wxWindowMSW::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags) { -#ifdef JOY_BUTTON1 int change = 0; if ( flags & JOY_BUTTON1CHG ) change = wxJOY_BUTTON1; @@ -5837,13 +5816,6 @@ bool wxWindowMSW::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags) event.SetEventObject(this); return HandleWindowEvent(event); -#else - wxUnusedVar(msg); - wxUnusedVar(x); - wxUnusedVar(y); - wxUnusedVar(flags); - return false; -#endif } // --------------------------------------------------------------------------- @@ -6074,11 +6046,9 @@ const struct wxKeyMapping { VK_NUMLOCK, WXK_NUMLOCK }, { VK_SCROLL, WXK_SCROLL }, -#ifdef VK_APPS { VK_LWIN, WXK_WINDOWS_LEFT }, { VK_RWIN, WXK_WINDOWS_RIGHT }, { VK_APPS, WXK_WINDOWS_MENU }, -#endif // VK_APPS defined { VK_BROWSER_BACK, WXK_BROWSER_BACK }, { VK_BROWSER_FORWARD, WXK_BROWSER_FORWARD }, @@ -6349,8 +6319,6 @@ WXWORD WXToVK(int wxk, bool *isExtended) // small helper for wxGetKeyState() and wxGetMouseState() static inline bool wxIsKeyDown(WXWORD vk) { - // SM_SWAPBUTTON is not available under CE, so don't swap buttons there -#ifdef SM_SWAPBUTTON if ( vk == VK_LBUTTON || vk == VK_RBUTTON ) { if ( ::GetSystemMetrics(SM_SWAPBUTTON) ) @@ -6361,7 +6329,6 @@ static inline bool wxIsKeyDown(WXWORD vk) vk = VK_LBUTTON; } } -#endif // SM_SWAPBUTTON // the low order bit indicates whether the key was pressed since the last // call and the high order one indicates whether it is down right now and From 7bfbbf7e830a3397fa1153bd1ddbb0d5930b7596 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 03:30:31 +0200 Subject: [PATCH 06/30] Remove check for `__TWIN32__` symbol --- src/msw/registry.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 82825ed324..e795961cca 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -939,10 +939,6 @@ bool wxRegKey::QueryValue(const wxString& szValue, long *plValue) const bool wxRegKey::SetValue(const wxString& szValue, const wxMemoryBuffer& buffer) { -#ifdef __TWIN32__ - wxFAIL_MSG("RegSetValueEx not implemented by TWIN32"); - return false; -#else if ( CONST_CAST Open() ) { m_dwLastError = RegSetValueEx((HKEY) m_hKey, RegValueStr(szValue), (DWORD) RESERVED, REG_BINARY, @@ -954,7 +950,6 @@ bool wxRegKey::SetValue(const wxString& szValue, const wxMemoryBuffer& buffer) wxLogSysError(m_dwLastError, _("Can't set value of '%s'"), GetFullName(this, szValue)); return false; -#endif } bool wxRegKey::QueryValue(const wxString& szValue, wxMemoryBuffer& buffer) const From fbf8f2b237fdf4f029da78dd8d37f294a49d209e Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:04:34 +0200 Subject: [PATCH 07/30] Remove checks for AC_SRC_ALPHA and LAYOUT_RTL --- src/msw/dc.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 07a8ded1f5..7dbeea7182 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -79,14 +79,6 @@ using namespace wxMSWImpl; -#ifndef AC_SRC_ALPHA - #define AC_SRC_ALPHA 1 -#endif - -#ifndef LAYOUT_RTL - #define LAYOUT_RTL 1 -#endif - /* Quaternary raster codes */ #ifndef MAKEROP4 #define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore)) From bda4c482715abcc837ddb61a2a22e216bd7d5923 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:05:53 +0200 Subject: [PATCH 08/30] Remove checks for INTERNET_CONNECTION_XXX --- src/msw/dialup.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index e40f73f9eb..5ff78e7c7e 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -57,14 +57,6 @@ wxDEFINE_EVENT( wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent ); #include -// Not in VC++ 5 -#ifndef INTERNET_CONNECTION_LAN -#define INTERNET_CONNECTION_LAN 2 -#endif -#ifndef INTERNET_CONNECTION_PROXY -#define INTERNET_CONNECTION_PROXY 4 -#endif - static const wxChar * wxMSWDIALUP_WNDCLASSNAME = wxT("_wxDialUpManager_Internal_Class"); static const wxChar *gs_classForDialUpWindow = NULL; From 0ff8012c4afaa0819e2d76eae9ff52e9688bc638 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:08:40 +0200 Subject: [PATCH 09/30] Remove checks for BIF_XXX --- src/msw/dirdlg.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index 092d9ef8d4..84557d7c95 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -147,18 +147,10 @@ DEFINE_GUID(IID_IFileDialog, // constants // ---------------------------------------------------------------------------- -#ifndef BIF_NEWDIALOGSTYLE - #define BIF_NEWDIALOGSTYLE 0x0040 -#endif - #ifndef BIF_NONEWFOLDERBUTTON #define BIF_NONEWFOLDERBUTTON 0x0200 #endif -#ifndef BIF_EDITBOX - #define BIF_EDITBOX 16 -#endif - // ---------------------------------------------------------------------------- // wxWidgets macros // ---------------------------------------------------------------------------- From b53a62a9706ef0d4e24e24826c19acc1193afe6d Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:10:52 +0200 Subject: [PATCH 10/30] Remove check for SM_CXCURSOR. --- src/msw/dragimag.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index 867ed0455b..85a56001df 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -334,14 +334,8 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullS #else if (!m_hCursorImageList) { -#ifndef SM_CXCURSOR - // Smartphone may not have these metric symbol - int cxCursor = 16; - int cyCursor = 16; -#else int cxCursor = ::GetSystemMetrics(SM_CXCURSOR); int cyCursor = ::GetSystemMetrics(SM_CYCURSOR); -#endif m_hCursorImageList = (WXHIMAGELIST) ImageList_Create(cxCursor, cyCursor, ILC_MASK, 1, 1); } From 5d3cf280222fc46240a5e5c2f8b9f2c41e7b4008 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:12:08 +0200 Subject: [PATCH 11/30] Remove check for HANGUL_CHARSET. --- src/msw/fontutil.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/msw/fontutil.cpp b/src/msw/fontutil.cpp index 97b9e7edbb..faae55ff18 100644 --- a/src/msw/fontutil.cpp +++ b/src/msw/fontutil.cpp @@ -37,11 +37,6 @@ #include "wx/fontmap.h" #include "wx/tokenzr.h" -// for MSVC5 and old w32api -#ifndef HANGUL_CHARSET -# define HANGUL_CHARSET 129 -#endif - // ============================================================================ // implementation // ============================================================================ From 73210723cd070b524a09f390ff1264d01f918151 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:15:55 +0200 Subject: [PATCH 12/30] Remove checks for PBS_XXX. --- src/msw/gauge.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/msw/gauge.cpp b/src/msw/gauge.cpp index 78d298ebc6..67fb5b8a63 100644 --- a/src/msw/gauge.cpp +++ b/src/msw/gauge.cpp @@ -40,15 +40,6 @@ // constants // ---------------------------------------------------------------------------- -// old commctrl.h (< 4.71) don't have those -#ifndef PBS_SMOOTH - #define PBS_SMOOTH 0x01 -#endif - -#ifndef PBS_VERTICAL - #define PBS_VERTICAL 0x04 -#endif - #ifndef PBM_SETBARCOLOR #define PBM_SETBARCOLOR (WM_USER+9) #endif From f3cda45ced51c9b8364627771165608146e41a48 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:17:54 +0200 Subject: [PATCH 13/30] Remove checks for MNS_CHECKORBMP, MIM_STYLE. --- src/msw/menu.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 6022b8f679..c7790aeacd 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -50,13 +50,6 @@ #include "wx/dynlib.h" -#ifndef MNS_CHECKORBMP - #define MNS_CHECKORBMP 0x04000000 -#endif -#ifndef MIM_STYLE - #define MIM_STYLE 0x00000010 -#endif - // ---------------------------------------------------------------------------- // global variables // ---------------------------------------------------------------------------- From b8ba653ef0b3d1f67ee0a90e617b9fd81e640688 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:19:27 +0200 Subject: [PATCH 14/30] Remove check for SPI_GETKEYBOARDCUES. --- src/msw/menuitem.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 98bc39413e..b294c795f3 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -143,10 +143,6 @@ inline bool IsGreaterThanStdSize(const wxBitmap& bmp) #include "wx/fontutil.h" #include "wx/msw/private/metrics.h" -#ifndef SPI_GETKEYBOARDCUES -#define SPI_GETKEYBOARDCUES 0x100A -#endif - #if wxUSE_UXTHEME enum MENUPARTS From 743810cf685c3d9935214db8d373d11775427111 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:20:28 +0200 Subject: [PATCH 15/30] Remove check for CHILDID_SELF. --- src/msw/ole/access.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/msw/ole/access.cpp b/src/msw/ole/access.cpp index e1812f2cc5..fd06b3043f 100644 --- a/src/msw/ole/access.cpp +++ b/src/msw/ole/access.cpp @@ -39,10 +39,6 @@ #include "wx/msw/ole/oleutils.h" -#ifndef CHILDID_SELF -#define CHILDID_SELF 0 -#endif - #ifndef OBJID_CLIENT #define OBJID_CLIENT 0xFFFFFFFC #endif From bdba8559cb2f60520248d28e1d310d73e3b1ad02 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:22:13 +0200 Subject: [PATCH 16/30] Remove check for VT_TYPEMASK. --- src/msw/ole/oleutils.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/msw/ole/oleutils.cpp b/src/msw/ole/oleutils.cpp index c0a173a639..57a19fc1a4 100644 --- a/src/msw/ole/oleutils.cpp +++ b/src/msw/ole/oleutils.cpp @@ -393,10 +393,6 @@ WXDLLEXPORT bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& ole return true; } -#ifndef VT_TYPEMASK -#define VT_TYPEMASK 0xfff -#endif - WXDLLEXPORT bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant, long flags) { From 35b2270a4a8b7f5d2c8bfb75bb100ae935e30166 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:23:25 +0200 Subject: [PATCH 17/30] Remove checks for HKEY_XXX. --- src/msw/registry.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index e795961cca..aef56fdec2 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -49,18 +49,6 @@ typedef unsigned char *RegString; typedef BYTE* RegBinary; -#ifndef HKEY_PERFORMANCE_DATA // (Obsolete under XP and later) - #define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004) -#endif - -#ifndef HKEY_CURRENT_CONFIG - #define HKEY_CURRENT_CONFIG ((HKEY)0x80000005) -#endif - -#ifndef HKEY_DYN_DATA // (Obsolete under XP and later) - #define HKEY_DYN_DATA ((HKEY)0x80000006) -#endif - #ifndef KEY_WOW64_64KEY #define KEY_WOW64_64KEY 0x0100 #endif From fefe380b5388fb27a161d725f3f540c9aa2fed05 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:25:25 +0200 Subject: [PATCH 18/30] Remove check for DFCS_HOT. --- src/msw/renderer.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index 8889507d2a..64eaff0ed9 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -126,10 +126,6 @@ #define TDLGEBS_EXPANDEDPRESSED 6 #endif -#ifndef DFCS_HOT - #define DFCS_HOT 0x1000 -#endif - // ---------------------------------------------------------------------------- // methods common to wxRendererMSW and wxRendererXP // ---------------------------------------------------------------------------- From 45818cd90b6c8e66f4a9f252fefaf6cc204b637b Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:26:30 +0200 Subject: [PATCH 19/30] Remove check for SPI_GETFLATMENU. --- src/msw/settings.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp index db3bb41560..e1aef8efbe 100644 --- a/src/msw/settings.cpp +++ b/src/msw/settings.cpp @@ -35,10 +35,6 @@ #include "wx/msw/missing.h" // for SM_CXCURSOR, SM_CYCURSOR, SM_TABLETPC #include "wx/msw/private/metrics.h" -#ifndef SPI_GETFLATMENU -#define SPI_GETFLATMENU 0x1022 -#endif - #include "wx/fontutil.h" #include "wx/fontenum.h" From d7ce8c023faff3e42df641ab59cba6f18f838d13 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:28:33 +0200 Subject: [PATCH 20/30] Remove checks for CSIDL_XXX and SHGFP_TYPE_XXX. --- src/msw/stdpaths.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/msw/stdpaths.cpp b/src/msw/stdpaths.cpp index 29aa6b9192..edc1517e66 100644 --- a/src/msw/stdpaths.cpp +++ b/src/msw/stdpaths.cpp @@ -51,34 +51,10 @@ typedef HRESULT (WINAPI *SHGetKnownFolderPath_t)(const GUID&, DWORD, HANDLE, PWS // used in our wxLogTrace messages #define TRACE_MASK wxT("stdpaths") -#ifndef CSIDL_APPDATA - #define CSIDL_APPDATA 0x001a -#endif - -#ifndef CSIDL_LOCAL_APPDATA - #define CSIDL_LOCAL_APPDATA 0x001c -#endif - -#ifndef CSIDL_COMMON_APPDATA - #define CSIDL_COMMON_APPDATA 0x0023 -#endif - -#ifndef CSIDL_PROGRAM_FILES - #define CSIDL_PROGRAM_FILES 0x0026 -#endif - #ifndef CSIDL_PERSONAL #define CSIDL_PERSONAL 0x0005 #endif -#ifndef SHGFP_TYPE_CURRENT - #define SHGFP_TYPE_CURRENT 0 -#endif - -#ifndef SHGFP_TYPE_DEFAULT - #define SHGFP_TYPE_DEFAULT 1 -#endif - // ---------------------------------------------------------------------------- // module globals // ---------------------------------------------------------------------------- From 299a06c86e56c27970e1f24999196e5c388974cb Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:31:44 +0200 Subject: [PATCH 21/30] Remove checks for NIN_XXX, NIM_SETVERSION, NIF_INFO, NOTIFYICONDATA_V2_SIZE. --- src/msw/taskbar.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 7b61f25e60..f40210841c 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -33,27 +33,6 @@ #include "wx/platinfo.h" #include "wx/msw/private.h" -#ifndef NIN_BALLOONTIMEOUT - #define NIN_BALLOONTIMEOUT 0x0404 - #define NIN_BALLOONUSERCLICK 0x0405 -#endif - -#ifndef NIM_SETVERSION - #define NIM_SETVERSION 0x00000004 -#endif - -#ifndef NIF_INFO - #define NIF_INFO 0x00000010 -#endif - -#ifndef NOTIFYICONDATA_V2_SIZE - #ifdef UNICODE - #define NOTIFYICONDATA_V2_SIZE 0x03A8 - #else - #define NOTIFYICONDATA_V2_SIZE 0x01E8 - #endif -#endif - // initialized on demand static UINT gs_msgTaskbar = 0; static UINT gs_msgRestartTaskbar = 0; From 2f5f5caf99239f03773291d089a879d75cb01a33 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:34:03 +0200 Subject: [PATCH 22/30] Remove checks for ACO_UPDOWNKEYDROPSLIST, SHACF_FILESYS_XXX, ACDD_VISIBLE. --- src/msw/textentry.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index 3a36a69abd..0a379aedf2 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -66,18 +66,6 @@ #endif #endif -#ifndef ACO_UPDOWNKEYDROPSLIST - #define ACO_UPDOWNKEYDROPSLIST 0x20 -#endif - -#ifndef SHACF_FILESYS_ONLY - #define SHACF_FILESYS_ONLY 0x00000010 -#endif - -#ifndef SHACF_FILESYS_DIRS - #define SHACF_FILESYS_DIRS 0x00000020 -#endif - // This must be the last header included to only affect the DEFINE_GUID() // occurrences below but not any GUIDs declared in the standard files included // above. @@ -104,10 +92,6 @@ DEFINE_GUID(wxIID_IAutoCompleteDropDown, DEFINE_GUID(wxCLSID_AutoComplete, 0x00bb2763, 0x6a77, 0x11d0, 0xa5, 0x35, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62); -#ifndef ACDD_VISIBLE - #define ACDD_VISIBLE 0x0001 -#endif - // Small helper class which can be used to ensure thread safety even when // wxUSE_THREADS==0 (and hence wxCriticalSection does nothing). class CSLock From e38762bc559843a55c68f9a23dac4825b107e85b Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:35:14 +0200 Subject: [PATCH 23/30] Remove check for TTTOOLINFO_V1_SIZE. --- src/msw/tooltip.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index e5937918f1..ffc0c4cbc9 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -38,10 +38,6 @@ #include "wx/vector.h" #include "wx/msw/private.h" -#ifndef TTTOOLINFO_V1_SIZE - #define TTTOOLINFO_V1_SIZE 0x28 -#endif - #ifndef TTF_TRANSPARENT #define TTF_TRANSPARENT 0x0100 #endif From 7b26050fb68833123f3e06916a2c4916107125d8 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:36:24 +0200 Subject: [PATCH 24/30] Remove checks for NIN_XXX. --- src/msw/toplevel.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 4a6e8078f7..ba880caae6 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -47,14 +47,6 @@ #include "wx/display.h" -#ifndef ICON_BIG - #define ICON_BIG 1 -#endif - -#ifndef ICON_SMALL - #define ICON_SMALL 0 -#endif - // NB: wxDlgProc must be defined here and not in dialog.cpp because the latter // is not included by wxUniv build which does need wxDlgProc LONG APIENTRY From 511ec447433523457eb8bf8cbf4319bd0fea4361 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:39:31 +0200 Subject: [PATCH 25/30] Remove old checks AW_XXX MAPVK_VK_TO_CHAR TME_LEAVE WM_MOUSELEAVE --- src/msw/window.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 8f426d89ca..61d86df378 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -121,27 +121,10 @@ #define ETS_ASSIST 7 #endif -// define the constants used by AnimateWindow() if our SDK doesn't have them -#ifndef AW_CENTER - #define AW_HOR_POSITIVE 0x00000001 - #define AW_HOR_NEGATIVE 0x00000002 - #define AW_VER_POSITIVE 0x00000004 - #define AW_VER_NEGATIVE 0x00000008 - #define AW_CENTER 0x00000010 - #define AW_HIDE 0x00010000 - #define AW_ACTIVATE 0x00020000 - #define AW_SLIDE 0x00040000 - #define AW_BLEND 0x00080000 -#endif - -#if defined(TME_LEAVE) && defined(WM_MOUSELEAVE) && wxUSE_DYNLIB_CLASS +#if wxUSE_DYNLIB_CLASS #define HAVE_TRACKMOUSEEVENT #endif // everything needed for TrackMouseEvent() -#ifndef MAPVK_VK_TO_CHAR - #define MAPVK_VK_TO_CHAR 2 -#endif - // --------------------------------------------------------------------------- // global variables // --------------------------------------------------------------------------- From f6b1a6bc16a74de7c7c18602d43fbc17dff2dfda Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:40:30 +0200 Subject: [PATCH 26/30] Remove check for ATTACH_PARENT_PROCESS. --- src/msw/app.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 910a96979e..d205f7e6ef 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -92,10 +92,6 @@ typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *); #endif // defined(DLLVERSIONINFO) -#ifndef ATTACH_PARENT_PROCESS - #define ATTACH_PARENT_PROCESS ((DWORD)-1) -#endif - // --------------------------------------------------------------------------- // global variables // --------------------------------------------------------------------------- From e81c4608087a748ad797f373d1856559613e627a Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 15:49:14 +0200 Subject: [PATCH 27/30] Keep defining ACDD_VISIBLE because shobjidl.h header is not included since it is missing from MinGW and Cygwin. --- src/msw/textentry.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index 0a379aedf2..3acadace87 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -92,6 +92,10 @@ DEFINE_GUID(wxIID_IAutoCompleteDropDown, DEFINE_GUID(wxCLSID_AutoComplete, 0x00bb2763, 0x6a77, 0x11d0, 0xa5, 0x35, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62); +#ifndef ACDD_VISIBLE + #define ACDD_VISIBLE 0x0001 +#endif + // Small helper class which can be used to ensure thread safety even when // wxUSE_THREADS==0 (and hence wxCriticalSection does nothing). class CSLock From 79256c2fe340b1098be8d4cd7640ad7f4bf72d9f Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 21:17:02 +0200 Subject: [PATCH 28/30] Revert "Remove check for TTTOOLINFO_V1_SIZE" Apparently some gcc flavors (like g++ (GCC) 5.3.0 from AppVeyor) do not define TTTOOLINFO_V1_SIZE, so keep the check for it. FWIW tdm-gcc-5.1.0 does not need it. This reverts commit e38762bc559843a55c68f9a23dac4825b107e85b. --- src/msw/tooltip.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index ffc0c4cbc9..e5937918f1 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -38,6 +38,10 @@ #include "wx/vector.h" #include "wx/msw/private.h" +#ifndef TTTOOLINFO_V1_SIZE + #define TTTOOLINFO_V1_SIZE 0x28 +#endif + #ifndef TTF_TRANSPARENT #define TTF_TRANSPARENT 0x0100 #endif From b8ced83a6c1bb2d19ce3db9dff3d6ddf9c7252d6 Mon Sep 17 00:00:00 2001 From: Catalin Date: Sun, 5 Mar 2017 22:25:34 +0200 Subject: [PATCH 29/30] Keep SHACF_FILESYS_XXX checks and definitions. Apparently some gcc flavors (like g++ (GCC) 5.3.0 from AppVeyor) do not define these symbols. FWIW tdm-gcc-5.1.0 does not need them. This partially reverts commit 2f5f5caf99239f03773291d089a879d75cb01a33. --- src/msw/textentry.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index 3acadace87..cd33b0c120 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -66,6 +66,14 @@ #endif #endif +#ifndef SHACF_FILESYS_ONLY + #define SHACF_FILESYS_ONLY 0x00000010 +#endif + +#ifndef SHACF_FILESYS_DIRS + #define SHACF_FILESYS_DIRS 0x00000020 +#endif + // This must be the last header included to only affect the DEFINE_GUID() // occurrences below but not any GUIDs declared in the standard files included // above. From 8e82435d703149541bff1bfbbf077f26ccd1ae2e Mon Sep 17 00:00:00 2001 From: Catalin Date: Mon, 6 Mar 2017 00:40:18 +0200 Subject: [PATCH 30/30] Keep `NIN_BALLOONxxx` checks and definitions. Apparently some gcc flavors (like g++ (GCC) 5.3.0 from AppVeyor) do not define these symbols. FWIW tdm-gcc-5.1.0 does not need them. This partially reverts commit 299a06c86e56c27970e1f24999196e5c388974cb. --- src/msw/taskbar.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index f40210841c..22583439bf 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -33,6 +33,11 @@ #include "wx/platinfo.h" #include "wx/msw/private.h" +#ifndef NIN_BALLOONTIMEOUT + #define NIN_BALLOONTIMEOUT 0x0404 + #define NIN_BALLOONUSERCLICK 0x0405 +#endif + // initialized on demand static UINT gs_msgTaskbar = 0; static UINT gs_msgRestartTaskbar = 0;