TEXTMETRIC tm;\r
RECT rc;\r
HFONT hfont, hold_font;\r
+ LONG old_width, new_width;\r
\r
// get the text metrics\r
hdc = GetDC(hText);\r
SendMessage(hText, EM_GETRECT, 0, (LPARAM)&rc);\r
\r
// update the width\r
- ics_update_width((rc.right-rc.left) / tm.tmAveCharWidth);\r
+ new_width = (rc.right-rc.left) / tm.tmAveCharWidth;\r
+ old_width = GetWindowLong(hText, GWL_USERDATA);\r
+ if (new_width != old_width)\r
+ {\r
+ ics_update_width(new_width);\r
+ SetWindowLong(hText, GWL_USERDATA, new_width);\r
+ }\r
}\r
\r
VOID\r
wMask = SendMessage(hText, EM_GETEVENTMASK, 0, 0L);\r
SendMessage(hText, EM_SETEVENTMASK, 0, wMask | ENM_LINK);\r
SendMessage(hText, EM_AUTOURLDETECT, TRUE, 0L);\r
+ SetWindowLong(hText, GWL_USERDATA, 79); // initialize the text window's width\r
\r
return FALSE;\r
\r