}\r
}\r
\r
+void UpdateICSWidth(HWND hText)\r
+{\r
+ HDC hdc;\r
+ TEXTMETRIC tm;\r
+ RECT rc;\r
+ HFONT hfont, hold_font;\r
+ \r
+ // get the text metrics\r
+ hdc = GetDC(hText);\r
+ hfont = CreateFontIndirect(&font[boardSize][CONSOLE_FONT]->lf);\r
+ hold_font = SelectObject(hdc, hfont);\r
+ GetTextMetrics(hdc, &tm);\r
+ SelectObject(hdc, hold_font);\r
+ DeleteObject(hfont);\r
+ ReleaseDC(hText, hdc);\r
+\r
+ // get the rectangle\r
+ SendMessage(hText, EM_GETRECT, 0, (LPARAM)&rc);\r
+\r
+ // update the width\r
+ ics_update_width((rc.right-rc.left) / tm.tmAveCharWidth);\r
+}\r
+\r
VOID\r
ChangedConsoleFont()\r
{\r
paraf.dxOffset = WRAP_INDENT;\r
SendMessage(hText, EM_SETPARAFORMAT, 0, (LPARAM) ¶f);\r
SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel);\r
+ UpdateICSWidth(hText);\r
}\r
\r
/*---------------------------------------------------------------------------*\\r
return OnMoving( &sd, hDlg, wParam, lParam );\r
\r
case WM_EXITSIZEMOVE:\r
+ UpdateICSWidth(hText);\r
return OnExitSizeMove( &sd, hDlg, wParam, lParam );\r
}\r
\r