/*\r
* wgamelist.c -- Game list window for WinBoard\r
*\r
- * Copyright 1995, 2009, 2010 Free Software Foundation, Inc.\r
+ * Copyright 1995, 2009, 2010, 2011 Free Software Foundation, Inc.\r
*\r
* Enhancements Copyright 2005 Alessandro Scotti\r
*\r
\r
VOID GameListHighlight(int index)\r
{\r
+ char buf[MSG_SIZ];\r
+ int i, res = 0;\r
if (gameListDialog == NULL) return;\r
+ for(i=0; res != LB_ERR; i++) {\r
+ res = SendDlgItemMessage( gameListDialog, OPT_GameListText, LB_GETTEXT, i, (LPARAM)buf );\r
+ if(index <= atoi( buf )) break;\r
+ }\r
SendDlgItemMessage(gameListDialog, OPT_GameListText,\r
- LB_SETCURSEL, index - 1, 0);\r
+ LB_SETCURSEL, i, 0);\r
}\r
\r
\r