开发者

How to detect a non Java program running in fullscreen mode?

开发者 https://www.devze.com 2023-03-13 23:35 出处:网络
I am currently developing a Java cross-platform (windows and mac os x) application running in background and displaying a pop-up window on some user\'s or system\'s events like \"Copy and Paste\" or p

I am currently developing a Java cross-platform (windows and mac os x) application running in background and displaying a pop-up window on some user's or system's events like "Copy and Paste" or programs' launching.

Nevertheless, I would like to detect first, if any other program, not necessarily developed in Java, is running in full screen mode. In that case, I would not display my window. For instance, when user is watching a movie in full screen (media player...), a Powerpoint presentation...

So here are my questions : 1. Is there any way to do such a thing in Java language? 2. If it's not possible, I will do my "full screen mode detector" in another language but it has to be able to communicate with my Java app to notify the presence of a full screen window. 3. If it's not possible (1) : do you know the best language to do it? I found other solutions in C# or C++ MFC( How to check if an other program is running in fullscreen mode, eg. a media开发者_如何学Python player ).

Any idea would be very useful. Thanks a lot.

Sebastian


Eventually I did one external program for each OS which checks if active window is in full screen mode or not and writes the result on standard output. My Java app calls the good program according to the OS and read the result.

I used :

  • C# for Windows
  • Carbon for Mac OS X

The hardest part was Mac OS X version.

Don't hesitate to ask me if you're interested in these programs.

Thanks again for your help!


You can capture screen with java.awt.Robot, can you implement algorithm based on screenshot?


The simplest solution is to give the user the option of enabling/disabling your pop-ups. That way they can pick and choose when to receive pop ups.

0

精彩评论

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

关注公众号