wt = (LPTSTR)malloc((wtlen+1)*sizeof(TCHAR));
wt = (LPTSTR)smalloc((wtlen+1)*sizeof(TCHAR));
static LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg,                                       WPARAM wParam, LPARAM lParam){    switch (nMsg) {      case WM_ERASEBKGND:        return TRUE;      case WM_PAINT:        {            HBRUSH hbr;            HGDIOBJ holdbr;            RECT cr;            int wtlen;            LPTSTR wt;            HDC hdc;            PAINTSTRUCT ps;            hdc = BeginPaint(hWnd, &ps);            SelectObject(hdc, tip_font);            SelectObject(hdc, GetStockObject(BLACK_PEN));            hbr = CreateSolidBrush(tip_bg);            holdbr = SelectObject(hdc, hbr);            GetClientRect(hWnd, &cr);            Rectangle(hdc, cr.left, cr.top, cr.right, cr.bottom);            wtlen = GetWindowTextLength(hWnd);            wt = (LPTSTR)malloc((wtlen+1)*sizeof(TCHAR));            GetWindowText(hWnd, wt, wtlen+1);            SetTextColor(hdc, tip_text);            SetBkColor(hdc, tip_bg);            TextOut(hdc, cr.left+3, cr.top+3, wt, wtlen);            free(wt);            SelectObject(hdc, holdbr);            DeleteObject(hbr);            EndPaint(hWnd, &ps);        }        return 0;      case WM_NCHITTEST:        return HTTRANSPARENT;      case WM_DESTROY:        DeleteObject(tip_font);        tip_font = NULL;        break;      case WM_SETTEXT:        {            LPCTSTR str = (LPCTSTR)lParam;            SIZE sz;            HDC hdc = CreateCompatibleDC(NULL);            SelectObject(hdc, tip_font);            GetTextExtentPoint32(hdc, str, _tcslen(str), &sz);            SetWindowPos(hWnd, NULL, 0, 0, sz.cx+6, sz.cy+6, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE);            InvalidateRect(hWnd, NULL, FALSE);            DeleteDC(hdc);        }        break;    }    return DefWindowProc(hWnd, nMsg, wParam, lParam);}