开发者

Java/Swing: adding items to the system menu

开发者 https://www.devze.com 2023-02-04 22:31 出处:网络
I forget what this is called exactly (I think it\'s the \"system menu\"), but in Windows there\'s an icon in the upper left of a window and if you click it, a popup menu be开发者_StackOverflow社区come

I forget what this is called exactly (I think it's the "system menu"), but in Windows there's an icon in the upper left of a window and if you click it, a popup menu be开发者_StackOverflow社区comes visible:

Java/Swing: adding items to the system menu

Is there a way to add a custom menu item to this in Swing?


I do not know a way to do this directly with pure Java/Swing. However, you can use JNI/JNA and GetSystemMenu function found in User32.dll to modify it.

Enables the application to access the window menu (also known as the system menu or the control menu) for copying and modifying.

Actually, Wikipedia has a good entry on the System Menu.

Some applications customize the system menu, typically through the GetSystemMenu WinAPI function.1 Cmd.exe is an example of this and offers the user an ability to change its preferences through its system menu (other applications typically offer the user to change their preferences through the normal menu below their window's title bar).

0

精彩评论

暂无评论...
验证码 换一张
取 消