I am currently developing an SWT java application on Windows 7. Usually the application will be minimized, and when there is an event on the serial port the application should maximizes itself. The following code does the maximization part.
private void bringToFront(final Shell shell) {
shell.getDisplay().asyncExec(new Runnable() {
public void run() {
if(!shell.getMaximized()){
shell.setMaximized(true);
}
shell.forceActive();
}
});
}
But sometimes the SWT application is maximized behind another application. For example, if I have a powerpoint running in Fullscreen mode maximized application is behind powerpoint presentation. I would like to get it maximized and bring in front of all other applications.
Can anyone help me?