GetWndSelIchLim (hwnd)
Returns the index of one past the last character in the selection in the window hwnd.