Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2007, 10:59 AM
Member
 
Join Date: Jul 2007
Posts: 4
bilal_ali_java is on a distinguished road
Suggestions required for solving a Java problem
Respected Members,
I am working on a project from quite some time, during this time I have consulted different books, web sites, posted various messages on various forums but still unable to get the solution, actually the solution which I am aiming should be purely Java based, below I am first stating the scenario and than my questions, I would be waiting for replies from your side, please give me suggestions that how to make this thing possible and please help me finding some pure Java solution to this problem(if a pure java solution) exists), following is the scenario:

Scenario:

I want to make a Java application which is continuously running in memory, by “continuously running in memory” I mean that when ever I start my PC the application starts running at the back end just like a Windows Service without any user intervention and when the PC is closed the application will off course stops working like all other windows services. Now what this application has to do is to continuously monitoring all the key strokes pressed from the keyboard by the user, when ever a user presses Ctrl-F3 ( pressing Control key and F3 keys together) than a pop up message will appear on the screen but if the user presses some other key or a combination of different key strokes than nothing will happen. This is the complete scenario which I am facing, now the questions which I have are as follows:

Questions:

1) How can I trap an event ( any particular key press event) from a Java program which is running in the windows service, handling key board events for a GUI based forms is quite simple but how can I trap an event for such a program, how can I bind my key press events to this program.
2) My second question is that how to add a Java program to a windows service so that every time I start my PC my program like all other services also starts running.
3) Last but not the least that I need a pure Java based solution, is this really possible and if not than what are the other ways to solve this scenario.

Thanking You in advance.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-10-2008, 05:23 AM
Nicholas Jordan's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Southwest
Posts: 571
Nicholas Jordan is on a distinguished road
some approaches may be considered
The challenge has been considered before, though we do not see a great and efficient discussion in the many books. In a discussion in another Java group, an arrival of oopinion was that there is no way to detect system shutdown from outside of the Java Virtual Machine was the consensus of that discusion. I neither read it nor know for sure. I do know that in considering my own design I arrived at a single class, extending Thread, and running at a lower-priority could be used to watch the keyboard for some sort of data.


Trapping keyboard events from Java running as a background service ( a service ) suggests you are looking for a way to recieve the SIG_TERM and so on which do not exist at the level of the Java API, there exist in some programming languages a method of detecting when exit programs is broadcast to all running programs. Trapping keyboard events in my opinion will have to have some sort of window I would think. Is it necessary that the process run with no window?

Starting every time windows starts up is done by adding what is called a shell shortcut to the start up menu. Once you figure it out it is like any other typed text.

This task has been accomplished by the Apache server, it can be done but may involve much study. Being able to have a window makes idea much more accomplishable.
__________________
Please provide your feedback on our
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-16-2008, 01:43 AM
Member
 
Join Date: Jan 2008
Posts: 22
mrcheeks is on a distinguished road
I suggest another language than java for your "keylogger". There are some OS keystrokes that I think you won't be able to capture (ALT-TAB comes into my mind and there might be many others)
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-16-2008, 02:11 AM
Senior Member
 
Join Date: Jun 2008
Posts: 449
Fubarable is on a distinguished road
Quote:
Originally Posted by mrcheeks View Post
I suggest another language than java for your "keylogger".
As implied by the quotes above, programs such as these are often used for nefarious purposes. I hope that your goals are honest.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any Datastructure Suggestions For An Unbalanced Tree? markus-sukram New To Java 0 03-26-2008 03:25 PM
Quick Job required in Java taxman Jobs Offered 0 01-02-2008 12:46 PM
I need a help in solving this method using vectors java_fun2007 New To Java 2 11-26-2007 08:51 PM
Help required: regarding java.net.URL api tarzan007 New To Java 3 11-07-2007 05:46 AM
Java application help and suggestions required bilal_ali_java Advanced Java 0 07-18-2007 04:11 PM


All times are GMT +3. The time now is 02:20 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org