CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    2

    Figure out if computer is locked?

    Hi All

    Is there a way in Java to figure out if my computer is locked or unlocked? I am planning to write a program in Java that will detect if my computer is locked/unlocked and accordingly take an appropriate action.

    Please advise.

    Thanks and Regards,
    Pratyush

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Figure out if computer is locked?

    What do you mean by the computer being locked?

    Java is platform independant so doing anything that requires calls to the OS is difficult in Java - it can be done but it requires some effort. If this requirement is main purpose of your program then you'd probably be better off using a different language.

  3. #3
    Join Date
    Jul 2009
    Posts
    2

    Re: Figure out if computer is locked?

    By locking I mean pressing 'Ctrl+Alt+Del' on your windows machine and locking it. You can also lock the screen in Linux. The computer can get locked also if it remains idle for a specific amount of time (either in Windows or in Linux).

    Thanks and Regards,
    Pratyush

  4. #4
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Figure out if computer is locked?

    As Keang says, Java is not the right tool for this kind of thing. You need to use a native language, e.g. for Windows use C/C++/C#.

    If the only tool you have is a hammer, you tend to see every problem as a nail...
    A. Maslow
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured