Bug 222752 - [Win32] READ_ONLY Combo with List visible can lose
programatically-setSelection

added workaround for windows version prior to windows 8.1

Change-Id: I0b97c1a59a0f1eed4ba4ba9d3c3e816c53169717
Signed-off-by: Eugen Neufeld <eneufeld@eclipsesource.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
index a196c4f..86f8b86 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
@@ -1962,8 +1962,25 @@
 	int count = (int)/*64*/OS.SendMessage (handle, OS.CB_GETCOUNT, 0, 0);
 	if (0 <= index && index < count) {
 		int selection = (int)/*64*/OS.SendMessage (handle, OS.CB_GETCURSEL, 0, 0);
+		//corner case for single elements combo boxes for Bug 222752
+		if (!OS.IsWinCE && OS.WIN32_VERSION < OS.VERSION (6, 2) && getListVisible() && (style & SWT.READ_ONLY) != 0 && count==1 && selection == OS.CB_ERR) {
+			OS.SendMessage (handle, OS.WM_KEYDOWN, OS.VK_DOWN, 0);
+			sendEvent (SWT.Modify);
+			return;
+		}
 		int code = (int)/*64*/OS.SendMessage (handle, OS.CB_SETCURSEL, index, 0);
 		if (code != OS.CB_ERR && code != selection) {
+			//Workaround for Bug 222752
+			if (!OS.IsWinCE && OS.WIN32_VERSION < OS.VERSION (6, 2) && getListVisible() && (style & SWT.READ_ONLY) != 0) {
+				int firstKey = OS.VK_UP;
+				int secondKey = OS.VK_DOWN;
+				if (index == 0) {
+					firstKey = OS.VK_DOWN;
+					secondKey = OS.VK_UP;
+				}
+				OS.SendMessage (handle, OS.WM_KEYDOWN, firstKey, 0);
+				OS.SendMessage (handle, OS.WM_KEYDOWN, secondKey, 0);
+			}
 			sendEvent (SWT.Modify);
 			// widget could be disposed at this point
 		}