• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java and hook?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I need to make a program (by using Java) that when opened, user cannot switch to any other programs and do anything else (connecting to usb, ...) except interacting with my program. This is only the first stage of the development so i do not have a clear idea about what technique i will use. Window hook looks promising but i am not so sure whether i am on the right direction or not. Do you have any suggestion for this?
 
Sheriff
Posts: 7136
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's the use of that kind of application? If I found an application like that, I will surely avoid using it.
 
Thai C. Tran
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ha ha. it is an online testing system. Nothing nasty here :d
 
Devaka Cooray
Sheriff
Posts: 7136
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Implementation of that kind of application depends on the underlying operating system. You need to use JNI for interacting with the lower level API based on the operating system.

Moving this to Other JSE/JEE APIs forum.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably too late, but anyway: in Windows this is next to impossible. Microsoft has spent last fifteen years trying to prevent applications exactly the behaviour you're trying to achieve (effectively locking out every other application on the system). Last occasion this was seriously possible was displaying system-modal dialog box in Windows 3.1

System hooks are nasty beasts. For starters, you'll need a DLL, for various reasons they cannot be successfully implemented in non-DLL code. Even so, some key combinations (most notably Ctrl-Alt-Del) cannot be intercepted by any other application for security reasons (otherwise keyloggers could intercept Ctrl-Alt-Del, display login screen and steal a password; you can even read this after clicking "help" in the old-style login screen in Windows XP).

With Ctrl-Alt-Del, your users can bring up the Task Manager and do pretty much anything.

Much better way (or the only way, in my opinion) is to create a very restricted user account which doesn't allow anything else than running your application. Though I don't know the details, this certainly is possible (I've been working with acounts in which even Window key+R was disallowed, preventing me to run arbitrary applications). I believe even USBs can be disabled this way. You'll just need to set up user rights and local/domain policies correctly.

If you need to run your application on computers you do not physically manage, you are probably out of luck.
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic