The minimal supported version is Windows XP. Building with older compilers
might still work, but these instructions might be outdated.
-If you need the executable to run on Windows 98 or ME, use the 2003 one
-|msvc-2003-toolkit| or |msvc-2005-express|, and use the source code before
-8.0.0029.
-
-Visual C++ Toolkit 2003 *msvc-2003-toolkit*
------------------------
-
-NOTE: this most likely does not work
-
-You could download the Microsoft Visual C++ Toolkit 2003 from
- http://msdn.microsoft.com/visualc/vctoolkit2003/
-Unfortunately this URL is no longer valid. Unofficial downloads appear to be
-available from links mentioned on these pages (use at your own risk):
- http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html
- http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit
-
-This contains the command-line tools (compiler, linker, CRT headers,
-and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
-To compile and debug Vim with the VC2003 Toolkit, you will also need
-|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
-and |windbg-download|.
-
-It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
-which is freely available in perpetuity.
-
-The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
- http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
-(This site also takes you through configuring a number of other
-free C compilers for Win32.)
-
-To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
-execute the following commands in a cmd.exe window (the msvcsetup.bat batch
-file can be used):
-
- set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
- call "%VCToolkitInstallDir%vcvars32.bat"
- set MSVCVer=7.1
- call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
- set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
-
-Now you can build Vim with Make_mvc.mak.
-
-
-Getting the Windows Platform SDK *ms-platform-sdk*
-
-You will also need a copy of the Windows Platform SDK. Specifically, you need
-the Windows Core SDK subset of the Platform SDK, which contains the Windows
-headers and libraries. You need to search for it, Microsoft keeps changing
-the URL.
-
-
-Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
-
-You need the .NET Framework 1.1 Redistributable Package from
- http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
-or from Windows Update:
- http://windowsupdate.microsoft.com/
-This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
-which is needed to link Vim.
-
-
-Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk*
-
-You need the .NET Framework 1.1 SDK from
- http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
-This contains some additional libraries needed to compile Vim,
-such as msvcrt.lib. You must install |dotnet-1.1-redist| before
-installing the .NET 1.1 SDK.
-
-
-Getting the WinDbg debugger *windbg-download*
-
-The Debugging Tools for Windows can be downloaded from
- http://www.microsoft.com/whdc/devtools/debugging/default.mspx
-This includes the WinDbg debugger, which you will want if you ever need
-to debug Vim itself. An earlier version of the Debugging Tools
-is also available through the Platform SDK, |ms-platform-sdk|.
+If you need the executable to run on Windows 98 or ME, use the 2005 one
+|msvc-2005-express|, and use the source code before 8.0.0029.
Visual C++ 2005 Express Edition *msvc-2005-express*
#define DLG_NONBUTTON_CONTROL 5000 // First ID of non-button controls
-#ifndef WM_XBUTTONDOWN // For Win2K / winME ONLY
-# define WM_XBUTTONDOWN 0x020B
-# define WM_XBUTTONUP 0x020C
-# define WM_XBUTTONDBLCLK 0x020D
-# define MK_XBUTTON1 0x0020
-# define MK_XBUTTON2 0x0040
-#endif
-
#ifndef WM_DPICHANGED
# define WM_DPICHANGED 0x02E0
#endif
typedef int HCURSOR;
#endif
-#ifndef GET_X_LPARAM
-# define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
-#endif
-
static void _OnPaint(HWND hwnd);
static void fill_rect(const RECT *rcp, HBRUSH hbr, COLORREF color);
static void clear_rect(RECT *rcp);
button = MOUSE_RIGHT;
else if (s_uMsg == WM_XBUTTONDOWN || s_uMsg == WM_XBUTTONDBLCLK)
{
-#ifndef GET_XBUTTON_WPARAM
-# define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam))
-#endif
button = ((GET_XBUTTON_WPARAM(s_wParam) == 1) ? MOUSE_X1 : MOUSE_X2);
}
else if (s_uMsg == WM_CAPTURECHANGED)
if (showit)
{
-# ifndef TB_SETUNICODEFORMAT
- // For older compilers. We assume this never changes.
-# define TB_SETUNICODEFORMAT 0x2005
-# endif
// Enable unicode support
SendMessage(s_toolbarhwnd, TB_SETUNICODEFORMAT, (WPARAM)TRUE,
(LPARAM)0);
if (s_tabhwnd == NULL)
return;
-# ifndef CCM_SETUNICODEFORMAT
- // For older compilers. We assume this never changes.
-# define CCM_SETUNICODEFORMAT 0x2005
-# endif
// Enable unicode support
SendMessage(s_tabhwnd, CCM_SETUNICODEFORMAT, (WPARAM)TRUE, (LPARAM)0);
return OK;
}
-#ifndef WPF_RESTORETOMAXIMIZED
-# define WPF_RESTORETOMAXIMIZED 2 // just in case someone doesn't have it
-#endif
-
/*
* Return TRUE if the GUI window is maximized, filling the whole screen.
* Also return TRUE if the window is snapped.
# include "xpm_w32.h"
#endif
-#ifdef __MINGW32__
-/*
- * Add a lot of missing defines.
- * They are not always missing, we need the #ifndef's.
- */
-# ifndef IsMinimized
-# define IsMinimized(hwnd) IsIconic(hwnd)
-# endif
-# ifndef IsMaximized
-# define IsMaximized(hwnd) IsZoomed(hwnd)
-# endif
-# ifndef SelectFont
-# define SelectFont(hdc, hfont) ((HFONT)SelectObject((hdc), (HGDIOBJ)(HFONT)(hfont)))
-# endif
-# ifndef GetStockBrush
-# define GetStockBrush(i) ((HBRUSH)GetStockObject(i))
-# endif
-# ifndef DeleteBrush
-# define DeleteBrush(hbr) DeleteObject((HGDIOBJ)(HBRUSH)(hbr))
-# endif
-
-# ifndef HANDLE_WM_RBUTTONDBLCLK
-# define HANDLE_WM_RBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), TRUE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_MBUTTONUP
-# define HANDLE_WM_MBUTTONUP(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_MBUTTONDBLCLK
-# define HANDLE_WM_MBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), TRUE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_LBUTTONDBLCLK
-# define HANDLE_WM_LBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), TRUE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_RBUTTONDOWN
-# define HANDLE_WM_RBUTTONDOWN(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), FALSE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_MOUSEMOVE
-# define HANDLE_WM_MOUSEMOVE(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_RBUTTONUP
-# define HANDLE_WM_RBUTTONUP(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_MBUTTONDOWN
-# define HANDLE_WM_MBUTTONDOWN(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), FALSE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_LBUTTONUP
-# define HANDLE_WM_LBUTTONUP(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_LBUTTONDOWN
-# define HANDLE_WM_LBUTTONDOWN(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), FALSE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_SYSCHAR
-# define HANDLE_WM_SYSCHAR(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
-# endif
-# ifndef HANDLE_WM_ACTIVATEAPP
-# define HANDLE_WM_ACTIVATEAPP(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (BOOL)(wParam), (DWORD)(lParam)), 0L)
-# endif
-# ifndef HANDLE_WM_WINDOWPOSCHANGING
-# define HANDLE_WM_WINDOWPOSCHANGING(hwnd, wParam, lParam, fn) \
- (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (LPWINDOWPOS)(lParam))
-# endif
-# ifndef HANDLE_WM_VSCROLL
-# define HANDLE_WM_VSCROLL(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (HWND)(lParam), (UINT)(LOWORD(wParam)), (int)(short)HIWORD(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_SETFOCUS
-# define HANDLE_WM_SETFOCUS(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (HWND)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_KILLFOCUS
-# define HANDLE_WM_KILLFOCUS(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (HWND)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_HSCROLL
-# define HANDLE_WM_HSCROLL(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (HWND)(lParam), (UINT)(LOWORD(wParam)), (int)(short)HIWORD(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_DROPFILES
-# define HANDLE_WM_DROPFILES(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (HDROP)(wParam)), 0L)
-# endif
-# ifndef HANDLE_WM_CHAR
-# define HANDLE_WM_CHAR(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
-# endif
-# ifndef HANDLE_WM_SYSDEADCHAR
-# define HANDLE_WM_SYSDEADCHAR(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
-# endif
-# ifndef HANDLE_WM_DEADCHAR
-# define HANDLE_WM_DEADCHAR(hwnd, wParam, lParam, fn) \
- ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
-# endif
-#endif // __MINGW32__
-
// Some parameters for tearoff menus. All in pixels.
#define TEAROFF_PADDING_X 2
#define TEAROFF_COLUMN_PADDING 3 // # spaces to pad column with.
-// For the Intellimouse:
-#ifndef WM_MOUSEWHEEL
-# define WM_MOUSEWHEEL 0x20a
-#endif
-
-
#ifdef FEAT_BEVAL_GUI
# define ID_BEVAL_TOOLTIP 200
# define BEVAL_TEXT_LEN MAXPATHL
static BalloonEval *cur_beval = NULL;
static UINT_PTR BevalTimerId = 0;
static DWORD LastActivity = 0;
-
-
-typedef struct tagNMTTDISPINFO_NEW
-{
- NMHDR hdr;
- LPSTR lpszText;
- char szText[80];
- HINSTANCE hinst;
- UINT uFlags;
- LPARAM lParam;
-} NMTTDISPINFO_NEW;
-
-typedef struct tagTOOLINFOW_NEW
-{
- UINT cbSize;
- UINT uFlags;
- HWND hwnd;
- UINT_PTR uId;
- RECT rect;
- HINSTANCE hinst;
- LPWSTR lpszText;
- LPARAM lParam;
- void *lpReserved;
-} TOOLINFOW_NEW;
-
-typedef struct tagNMTTDISPINFOW_NEW
-{
- NMHDR hdr;
- LPWSTR lpszText;
- WCHAR szText[80];
- HINSTANCE hinst;
- UINT uFlags;
- LPARAM lParam;
-} NMTTDISPINFOW_NEW;
-
-
-# ifndef TTM_SETMAXTIPWIDTH
-# define TTM_SETMAXTIPWIDTH (WM_USER+24)
-# endif
-
-# ifndef TTF_DI_SETITEM
-# define TTF_DI_SETITEM 0x8000
-# endif
-
-# ifndef TTN_GETDISPINFO
-# define TTN_GETDISPINFO (TTN_FIRST - 0)
-# endif
-
#endif // defined(FEAT_BEVAL_GUI)
-#if defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)
-// Older MSVC compilers don't have LPNMTTDISPINFO[AW] thus we need to define
-// it here if LPNMTTDISPINFO isn't defined.
-// MinGW doesn't define LPNMTTDISPINFO but typedefs it. Thus we need to check
-// _MSC_VER.
-# if !defined(LPNMTTDISPINFO) && defined(_MSC_VER)
-typedef struct tagNMTTDISPINFOA {
- NMHDR hdr;
- LPSTR lpszText;
- char szText[80];
- HINSTANCE hinst;
- UINT uFlags;
- LPARAM lParam;
-} NMTTDISPINFOA, *LPNMTTDISPINFOA;
-# define LPNMTTDISPINFO LPNMTTDISPINFOA
-
-typedef struct tagNMTTDISPINFOW {
- NMHDR hdr;
- LPWSTR lpszText;
- WCHAR szText[80];
- HINSTANCE hinst;
- UINT uFlags;
- LPARAM lParam;
-} NMTTDISPINFOW, *LPNMTTDISPINFOW;
-# endif
-#endif
-
-#ifndef TTN_GETDISPINFOW
-# define TTN_GETDISPINFOW (TTN_FIRST - 10)
-#endif
// Local variables:
static void
init_mouse_wheel(void)
{
-
-#ifndef SPI_GETWHEELSCROLLLINES
-# define SPI_GETWHEELSCROLLLINES 104
-#endif
-#ifndef SPI_SETWHEELSCROLLLINES
-# define SPI_SETWHEELSCROLLLINES 105
-#endif
-
-#define VMOUSEZ_CLASSNAME "MouseZ" // hidden wheel window class
-#define VMOUSEZ_TITLE "Magellan MSWHEEL" // hidden wheel window title
-#define VMSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
-#define VMSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
-
mouse_scroll_lines = 3; // reasonable default
// if NT 4.0+ (or Win98) get scroll lines directly from system
#endif
#ifdef FEAT_EVAL
-# if !defined(_MSC_VER) || (_MSC_VER < 1400)
-// Define HandleToLong for old MS and non-MS compilers if not defined.
-# ifndef HandleToLong
-# define HandleToLong(h) ((long)(intptr_t)(h))
-# endif
-# endif
// set the v:windowid variable
set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd));
#endif
#if defined(FEAT_TOOLBAR) || defined(PROTO)
# include "gui_w32_rc.h"
-// This not defined in older SDKs
-# ifndef TBSTYLE_FLAT
-# define TBSTYLE_FLAT 0x0800
-# endif
-
/*
* Create the toolbar, initially unpopulated.
* (just like the menu, there are no defaults, it's all
static void
make_tooltip(BalloonEval *beval, char *text, POINT pt)
{
- TOOLINFOW_NEW *pti;
- RECT rect;
+ TOOLINFOW *pti;
+ RECT rect;
- pti = alloc(sizeof(TOOLINFOW_NEW));
+ pti = alloc(sizeof(TOOLINFOW));
if (pti == NULL)
return;
SetWindowPos(beval->balloon, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- pti->cbSize = sizeof(TOOLINFOW_NEW);
+ pti->cbSize = sizeof(TOOLINFOW);
pti->uFlags = TTF_SUBCLASS;
pti->hwnd = beval->target;
pti->hinst = 0; // Don't use string resources
case TTN_GETDISPINFO:
{
// if you get there then we have new common controls
- NMTTDISPINFO_NEW *info = (NMTTDISPINFO_NEW *)pnmh;
+ NMTTDISPINFO *info = (NMTTDISPINFO *)pnmh;
info->lpszText = (LPSTR)info->lParam;
info->uFlags |= TTF_DI_SETITEM;
}
case TTN_GETDISPINFOW:
{
// if we get here then we have new common controls
- NMTTDISPINFOW_NEW *info = (NMTTDISPINFOW_NEW *)pnmh;
+ NMTTDISPINFOW *info = (NMTTDISPINFOW *)pnmh;
info->lpszText = (LPWSTR)info->lParam;
info->uFlags |= TTF_DI_SETITEM;
}