X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/5b80d07f712ff90cfae4c89084e25eb90dd2e510..01c034ad857128c51482a563befb374e38ebe668:/sizetip.c diff --git a/sizetip.c b/sizetip.c index 2e82c181..8a37b478 100644 --- a/sizetip.c +++ b/sizetip.c @@ -1,17 +1,11 @@ #include -#ifndef AUTO_WINSOCK -#ifdef WINSOCK_TWO -#include -#else -#include -#endif -#endif #include #include #include #include #include "putty.h" +#include "winstuff.h" static ATOM tip_class = 0; @@ -49,7 +43,7 @@ static LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg, Rectangle(hdc, cr.left, cr.top, cr.right, cr.bottom); wtlen = GetWindowTextLength(hWnd); - wt = (LPTSTR)malloc((wtlen+1)*sizeof(TCHAR)); + wt = (LPTSTR)smalloc((wtlen+1)*sizeof(TCHAR)); GetWindowText(hWnd, wt, wtlen+1); SetTextColor(hdc, tip_text); @@ -57,7 +51,7 @@ static LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg, TextOut(hdc, cr.left+3, cr.top+3, wt, wtlen); - free(wt); + sfree(wt); SelectObject(hdc, holdbr); DeleteObject(hbr); @@ -114,7 +108,7 @@ void UpdateSizeTip(HWND src, int cx, int cy) wc.lpfnWndProc = SizeTipWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; - wc.hInstance = putty_inst; + wc.hInstance = hinst; wc.hIcon = NULL; wc.hCursor = NULL; wc.hbrBackground = NULL; @@ -171,7 +165,7 @@ void UpdateSizeTip(HWND src, int cx, int cy) tip_wnd = CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_TOPMOST, MAKEINTRESOURCE(tip_class), str, WS_POPUP, ix, iy, sz.cx, sz.cy, - NULL, NULL, putty_inst, NULL); + NULL, NULL, hinst, NULL); ShowWindow(tip_wnd, SW_SHOWNOACTIVATE);