Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2020-06-30 13:21:43 +0000
committerNiraj Modi2020-07-02 11:17:48 +0000
commit9d34da688c29c07551c28be16afa1b2ac160f557 (patch)
tree3745e21c4c23a4fcf1b8bded8efa570a16923e03 /bundles
parente154ac3f53d27889a3bec1610ed408113abefc74 (diff)
downloadeclipse.platform.swt-9d34da688c29c07551c28be16afa1b2ac160f557.tar.gz
eclipse.platform.swt-9d34da688c29c07551c28be16afa1b2ac160f557.tar.xz
eclipse.platform.swt-9d34da688c29c07551c28be16afa1b2ac160f557.zip
Bug 552980 - [Win32] Fix missing Taskbar detection on Windows Server Core
Change-Id: I6a15b2c2e8a10d6df2979964f25f0462188c29b5 Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java1
3 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
index 68e981875f..1bff66d624 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
@@ -196,6 +196,7 @@ public class COM extends OS {
public static final int OLEEMBEDDED = 1;
public static final int OLELINKED = 0;
public static final int OLERENDER_DRAW = 1;
+ public static final int REGDB_E_CLASSNOTREG = 0x80040154;
public static final int S_FALSE = 1;
public static final int S_OK = 0;
public static final int STGC_DEFAULT = 0;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index 9e9fd84cd6..e2e735f4e4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -2538,7 +2538,15 @@ public TaskBar getSystemTaskBar () {
checkDevice ();
if (taskBar != null) return taskBar;
if (OS.WIN32_VERSION >= OS.VERSION (6, 1)) {
- taskBar = new TaskBar (this, SWT.NONE);
+ try {
+ taskBar = new TaskBar (this, SWT.NONE);
+ } catch (SWTError e) {
+ if (e.code == SWT.ERROR_NOT_IMPLEMENTED) {
+ // Windows Server Core doesn't have a Taskbar
+ return null;
+ }
+ throw e;
+ }
}
return taskBar;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java
index 3048ea18b9..2e0f35c715 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java
@@ -72,6 +72,7 @@ TaskBar (Display display, int style) {
void createHandle () {
long[] ppv = new long [1];
int hr = COM.CoCreateInstance (COM.CLSID_TaskbarList, 0, COM.CLSCTX_INPROC_SERVER, COM.IID_ITaskbarList3, ppv);
+ if (hr == COM.REGDB_E_CLASSNOTREG) error (SWT.ERROR_NOT_IMPLEMENTED);
if (hr != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
mTaskbarList3 = new ITaskbarList3 (ppv [0]);
}

Back to the top