在Java中隐藏Windows任务栏? [英] Hide Windows taskbar in Java?

查看:366
本文介绍了在Java中隐藏Windows任务栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Java隐藏Windows任务栏.我怎样才能做到这一点?我的编译器是带有JDK 7的Eclipse.我曾尝试使用setSize()达到完整分辨率,但任务栏位于它的前面.

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.

推荐答案

是的,您可以使用 JNA ,从 FindWindow 问题并阅读

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:

警告:这与自动隐藏不同.为了找回它,您需要再次调用ShowWindow,但要使用SW_SHOW.

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);
}

另请参见: SHAppBarMessage和AutoHide

这篇关于在Java中隐藏Windows任务栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆