2014-02-18 76 views
1

我試圖最小化所有打開的應用程序,並使用下面的代碼:最小化所有應用程序

public class Test { 
    public static void main(String args[]) throws Exception{ 
     Runtime.getRuntime().exec 
     (new String[] { 
     "cmd.exe", 
     "/c", 
     "\"" + System.getenv("APPDATA") + 
     "\\Microsoft\\Internet Explorer\\Quick Launch\\Show Desktop.scf" + "\"" 
     }); 
    } 
} 

當我運行的代碼,沒有任何反應。

我使用Windows 7,當我打開Internet Explorer一些病毒的原因,PC崩潰(也許是有聯繫?)

+0

[可能的複製(http://stackoverflow.com/questions/18973185 /最小化 - 所有其他應用程序 - 不包括我自己的程序) –

+3

你爲什麼要這麼做?如果某個程序爲我最小化所有窗口,我總是生氣。 – Maroun

+0

@MarounMaroun用戶可以選擇單擊或不按鈕,將最小化所有窗口。 – Presen

回答

4

這裏是顯示桌面,使用Java的Robot類的方法。
該類模擬鼠標和鍵盤輸入。

​​
-1

遍歷以下路徑: 「\微軟\的Internet Explorer \快速啓動\」

,並勾選 「文件名」 和 「擴展」。

在我的情況是:顯示Desktop.lnk

Windows 7中的名稱更改爲 「顯示Desktop.lnk」

相關問題