- In Windows OS, assign taskbar group ID to emulator-manager.
Group ID allows an application to group its associated processes and
windows under a single taskbar button.
Change-Id: Ic3da7a6195ebcbf322fa424ecc015a0572d1765f
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
<property name="proto.file" value="protobuf.jar" />
<property name="swt.file" value="swt.jar" />
<property name="jsch.file" value="jsch-0.1.50.jar" />
+ <property name="jna.file" value="jna-4.1.0.jar" />
<property name="common.dir" value="common-project" />
<property name="plugin.dir" value="plugin-project" />
<fileset dir="${common.dir}/lib" includes="${swt.file}" />
<fileset dir="${common.dir}/lib" includes="${jsch.file}" />
<fileset dir="${common.dir}/lib" includes="${proto.file}" />
+ <fileset dir="${common.dir}/lib" includes="${jna.file}" />
</path>
<path id="plugin-classpath">
<fileset file="about.properties" />
<manifest>
<attribute name="Main-Class" value="${mainclass}" />
- <attribute name="Class-path" value="${swt.file} ${jsch.file} ${proto.file}" />
+ <attribute name="Class-path" value="${swt.file} ${jsch.file} ${proto.file} ${jna.file}" />
</manifest>
</jar>
</target>
<fileset dir="${classpath.dibs}" includes="${swt.file}" />
<fileset dir="${classpath.dibs}" includes="${jsch.file}" />
<fileset dir="${classpath.dibs}" includes="${proto.file}" />
+ <fileset dir="${classpath.dibs}" includes="${jna.file}" />
</path>
<path id="plugin-classpath-dibs">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_51"/>
<classpathentry exported="true" kind="lib" path="lib/jsch-0.1.50.jar"/>
<classpathentry kind="lib" path="lib/protobuf.jar"/>
+ <classpathentry kind="lib" path="lib/jna-4.1.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
import org.tizen.emulator.manager.ui.dialog.MessageDialog;
import org.tizen.emulator.manager.vms.helper.WorkerLock;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLong;
+import com.sun.jna.WString;
+
public class EmulatorManager {
//private static EmulatorManager instance = null;
private static int current_tab_index;
} else if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
isMac = true;
}
+ if (isWin) {
+ Native.register("shell32");
+ }
+ }
+
+ public static void setProcessAppUserModelID(final String appID) {
+ long S_OK = 0;
+ NativeLong result = SetCurrentProcessExplicitAppUserModelID(new WString(appID));
+ if (result.longValue() == S_OK) {
+ EMLogger.getLogger().log(Level.INFO, "Set process AppUserModelID to " + appID);
+ } else {
+ EMLogger.getLogger().log(Level.WARNING, "Failed to set process AppUserModelID to " + appID);
+ }
}
+ // Specifies a unique application-defined Application User Model ID (AppUserModelID)
+ // that identifies the current process to the taskbar.
+ // (http://msdn.microsoft.com/en-us/library/windows/desktop/dd378422%28v=vs.85%29.aspx)
+ private static native NativeLong SetCurrentProcessExplicitAppUserModelID(WString appID);
+
public static void setCurrentTabIndex(int index){
current_tab_index = index;
}
}
public static void main(String[] args) {
+ if (isWin) {
+ // Running icon grouping ID on taskbar.
+ setProcessAppUserModelID(EmulatorManager.class.getName());
+ }
//
Runtime.getRuntime().addShutdownHook(new Thread(new EMShutdownHook()));
//