3

What I want to achieve is this:

On Windows platform:

  1. Right click on a window (some context menu will show up)
  2. Capture the screenshot into a bitmap.
  3. Create a window containing the screenshot on top of everything in the screen, including the context window.

Is step 3 possible?

ADD 1

I am going through the Window Styles from the 2 links below:

Extended Windows Styles

Windows Styles

Not sure if they can help me.

smwikipedia
  • 61,609
  • 92
  • 309
  • 482
  • Don't see what would stop you. – Harry Johnston Aug 12 '15 at 03:43
  • @HarryJohnston I guess it should be possible. But I don't know how to do that. Any specific Win32 API? I have made some attempt. But my Swing window cannot overlay on top of the context menu on Windows desktop, which means it cannot `intercept` the input focus before the context menu. – smwikipedia Aug 12 '15 at 03:57
  • Try `Robot#createScreenCapture()`, for [example](http://stackoverflow.com/a/3742841/230513). – trashgod Aug 12 '15 at 15:53

1 Answers1

0

I discovered a solution in C# that may be applicable. If you bring the window to the front after the context menu has been created, it will bring it in front of the context menu. You can emulate a window that is always on top of everything on the screen by repeatedly bringing it to the front in a background thread.

Here is the C# implementation:

How to draw on top of the right-click menu in .NET/C#?

This link may also help. I don't know if the same process could be used to display on top of the right-click menu, especially not in Java, but it may be worth a look:

How can I make my own application on top in the start menu?

Community
  • 1
  • 1
JCC
  • 492
  • 3
  • 17