--- np2/win9x/toolwin.cpp 2005/03/20 13:12:49 1.19 +++ np2/win9x/toolwin.cpp 2006/12/24 00:52:30 1.21 @@ -197,7 +197,11 @@ static void calctextsize(OEMCHAR *path, GetTextExtentPoint32(hdc, work, OEMSTRLEN(work), &tail); pos = 0; while(pos < l) { - step = ((((p[pos] ^ 0x20) - 0xa1) & 0xff) < 0x3c)?2:1; +#if defined(_UNICODE) + step = 1; +#else + step = (IsDBCSLeadByte((BYTE)p[pos]))?2:1; +#endif GetTextExtentPoint32(hdc, p, pos + step, &cur); if (cur.cx + tail.cx >= width) { break; @@ -460,8 +464,8 @@ static void toolwincreate(HWND hWnd) { toolwin.sub[i] = sub; toolwin.subproc[i] = NULL; if (sub) { - toolwin.subproc[i] = (SUBCLASSPROC)GetWindowLong(sub, GWL_WNDPROC); - SetWindowLong(sub, GWL_WNDPROC, (LONG)twsub); + toolwin.subproc[i] = GetWindowProc(sub); + SetWindowProc(sub, twsub); SendMessage(sub, WM_SETFONT, (WPARAM)toolwin.hfont, MAKELPARAM(TRUE, 0)); }