I want to hide the Windows taskbar with Java. How can I do this? My compiler is Eclipse with JDK 7. I have tried using setSize() to go to full resolution, but the taskbar goes in front of it.
解决方案
Yes, you can by using JNA, adopted from technet forums some help from a JNA FindWindow question and reading the JNA source code for Win32:
Warning: This isn't the same as auto-hide. To get it back, you'll need to invoke ShowWindow again, but with SW_SHOW.
private static int SW_HIDE = 0;
private static int SW_SHOW = 1;
public static void main(String... args) throws Exception {
WinDef.HWND shellTray = User32.INSTANCE.FindWindow("Shell_TrayWnd", "");
User32.INSTANCE.ShowWindow(shellTray, SW_HIDE);
}