Skip to content
Snippets Groups Projects
Commit 8730e457 authored by Francis Beaudet's avatar Francis Beaudet Committed by Alexandre Julliard
Browse files

Fixed LB_GETCURSEL message to return LB_ERR on empty list.

parent 8e7cb4db
No related branches found
No related tags found
No related merge requests found
......@@ -2228,8 +2228,13 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
case LB_GETCURSEL16:
case LB_GETCURSEL:
retvalue = descr->selected_item;
if (retvalue == -1) retvalue = descr->focus_item;
if (descr->nb_items==0)
retvalue = LB_ERR;
else
{
retvalue = descr->selected_item;
if (retvalue == -1) retvalue = descr->focus_item;
}
/* otherwise, if the user tries to move the selection with the */
/* arrow keys, we will give the application something to choke on */
goto END;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment