X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/b73fd1b14f758cc52b47b1cec9c68ba52fee70ac..301b66db61ce7434db602b228ffb4f087f29a368:/sizetip.c diff --git a/sizetip.c b/sizetip.c index 90c05732..2e82c181 100644 --- a/sizetip.c +++ b/sizetip.c @@ -1,17 +1,26 @@ #include +#ifndef AUTO_WINSOCK +#ifdef WINSOCK_TWO +#include +#else +#include +#endif +#endif #include #include #include +#include #include "putty.h" -ATOM tip_class = 0; +static ATOM tip_class = 0; -HFONT tip_font; -COLORREF tip_bg; -COLORREF tip_text; +static HFONT tip_font; +static COLORREF tip_bg; +static COLORREF tip_text; -LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg, + WPARAM wParam, LPARAM lParam) { switch (nMsg) { @@ -85,12 +94,12 @@ LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar return DefWindowProc(hWnd, nMsg, wParam, lParam); } -HWND tip_wnd = NULL; -int tip_enabled = 0; +static HWND tip_wnd = NULL; +static int tip_enabled = 0; void UpdateSizeTip(HWND src, int cx, int cy) { - TCHAR str[16]; + TCHAR str[32]; if (!tip_enabled) return; @@ -136,8 +145,7 @@ void UpdateSizeTip(HWND src, int cx, int cy) /* Generate the tip text */ - _sntprintf(str, 16, "%dx%d", cx, cy); - + sprintf(str, "%dx%d", cx, cy); if (!tip_wnd) { HDC hdc;