-1

I want to set a window invisible but focused for a fraction of seconds.

I'm writing a key board emulator using Robot class as a part of project for detecting key loggers.

Keyboard emulator should not disrupt the normal work of the user, so I want to set a hidden window focused for a short span so that the keys entered by the robot class received by the hidden window instead of normal user applications.

Is there any way to do this in Java when window is actually invisible? How to do this? at least in windows platform?

How about transparent full screen window in case the above thing is not possible?

My base paper: http://www.atlantis-press.com/php/download_paper.php?id=9980

eltabo
  • 3,749
  • 1
  • 21
  • 33
pinkpanther
  • 4,770
  • 2
  • 38
  • 62
  • I'm afraid this is not going to work without any native unsafe memory trickery. – Martijn Courteaux Jan 03 '14 at 14:09
  • 1
    An invisible window automatically loses the focus. But maybe some hackery around the swing glasspane is possible. – Meno Hochschild Jan 03 '14 at 14:16
  • @MenoHochschild that paper mentions windows winapi, but I want to do it in Java – pinkpanther Jan 03 '14 at 14:17
  • What are you trying to achieve with this? – Sorter Jan 03 '14 at 14:18
  • @DeepakMishra I'm gonna run key emulator so that the key presses will be directed to hidden window instead of normal applications. But, keyloggers will ultimately try to access files and network to save the keys so that we can detect such key loggers. – pinkpanther Jan 03 '14 at 14:21
  • @MenoHochschild how about transparent window? – pinkpanther Jan 03 '14 at 14:31
  • If this is at all possible I would try it with the glass pane. A second window has to be placed to the same positions as the visible one which might be tricky. A glass pane can also receive any keyboard input. – Meno Hochschild Jan 03 '14 at 14:39
  • _key board emulator using Robot_ and _detecting key loggers_ are unrelated requirements (and none has any inherent relation to a window, visible or not) - so what exactly *is* your goal? – kleopatra Jan 04 '14 at 09:02
  • @kleopatra my goal is to amplify the behavior of keylogger(if any) in a system using key emulator so we can detect those applications which frequently access file or network using Dendritic Cell Algorithm. Key emulator should not disrupt the normal applications, that's why I want to create a dummy window and set focus to that window so that the key inputs will be received by the dummy window instead of normal applications....! – pinkpanther Jan 04 '14 at 12:20

1 Answers1

1

Is there any way to do this in Java when window is actually invisible?

No. Not in pure Java at least.

How about transparent full screen window in case the above thing is not possible?

A transparent window does not receive events. So again, no.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433