Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. How can I disable my Window 7 Desktop in Java

How can I disable my Window 7 Desktop in Java

Scheduled Pinned Locked Moved Java
questionjavahelp
25 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Nagy Vilmos

    So you allow a user x minutes on the machine then lock it? I would not try this using Java, you will find it is going to be easier to use a lower language such as C++.


    Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

    F Offline
    F Offline
    flashery
    wrote on last edited by
    #8

    Yes that's it thanks I will convert to C++ now. Thanks for all your help guys..

    1 Reply Last reply
    0
    • F flashery

      How can I disable my Window 7 Desktop in Java while showing some warning? I am making a Timer program in java and need to disable the desktop if the time is over and enable again if the admin allows it. I just want to know the keyword of disabling and enabling the desktop. Just like this To shutdown a PC = shutdown -s Any help is appreciated. :) :)

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #9

      flashery wrote:

      How can I disable my Window 7 Desktop in Java while showing some warning?

      Not possible. Best that you can do, maybe, is produce a full screen view and that is far from disabling. The generic term for a box with an application where the application completely controls access to the box is 'kiosk' as that type of software needs to do exactly that. And typically there are quite a few things that one needs to disallow, remove and/or intercept to pre-empt all access.

      1 Reply Last reply
      0
      • F flashery

        How can I disable my Window 7 Desktop in Java while showing some warning? I am making a Timer program in java and need to disable the desktop if the time is over and enable again if the admin allows it. I just want to know the keyword of disabling and enabling the desktop. Just like this To shutdown a PC = shutdown -s Any help is appreciated. :) :)

        T Offline
        T Offline
        TorstenH
        wrote on last edited by
        #10

        now you've heard so much things you CAN'T do. Here is what you can do: Make a pop up dialog that is top most. It will appear in front of all other applications and must be confirmed. You can also let that dialog play some annoying sound.

        regards Torsten I never finish anyth...

        F 1 Reply Last reply
        0
        • T TorstenH

          now you've heard so much things you CAN'T do. Here is what you can do: Make a pop up dialog that is top most. It will appear in front of all other applications and must be confirmed. You can also let that dialog play some annoying sound.

          regards Torsten I never finish anyth...

          F Offline
          F Offline
          flashery
          wrote on last edited by
          #11

          Yeah that's right but you can access some window which is not its parent. What I want is a pop up dialog that will surely disabled all the access of the desktop except the pop up dialog itself. Can I do it in java?

          T L 2 Replies Last reply
          0
          • F flashery

            Yeah that's right but you can access some window which is not its parent. What I want is a pop up dialog that will surely disabled all the access of the desktop except the pop up dialog itself. Can I do it in java?

            T Offline
            T Offline
            TorstenH
            wrote on last edited by
            #12

            you can't disable other applications - but the dialog will pop up in front of all applications and stay there. The user can work on other applications but has always the popup in sight. An alarm sound can be looped until the user acknowledges the alert. You can make it impossible to work with other applications if you make the dialog of the popup a bit bigger, but that's more annoying than useful.

            regards Torsten I never finish anyth...

            F 1 Reply Last reply
            0
            • F flashery

              Yeah that's right but you can access some window which is not its parent. What I want is a pop up dialog that will surely disabled all the access of the desktop except the pop up dialog itself. Can I do it in java?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #13

              No! Windows is specifically designed so that the user is the one to make such decisions, not applications. Think of the havoc that would ensue if this was possible; every virus writer, hacker, and Q&A dummy would be releasing programs that blocked PC systems. You could, however, use the Windows ExitWindowsEx()[^] function, but that would mean writing some C code, and it would still be difficult to force the application to start without some form of service to control it.

              Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

              F 1 Reply Last reply
              0
              • T TorstenH

                you can't disable other applications - but the dialog will pop up in front of all applications and stay there. The user can work on other applications but has always the popup in sight. An alarm sound can be looped until the user acknowledges the alert. You can make it impossible to work with other applications if you make the dialog of the popup a bit bigger, but that's more annoying than useful.

                regards Torsten I never finish anyth...

                F Offline
                F Offline
                flashery
                wrote on last edited by
                #14

                Yeah that's what I am afraid of using just pop up dialog. I think it much better if I am going to make full screen window with matching some keyboard disabled such as alt+tab, alt+escape and any other keyboard shortcut that will switch window to window. I think it is much better? How was it?

                T J 2 Replies Last reply
                0
                • L Lost User

                  No! Windows is specifically designed so that the user is the one to make such decisions, not applications. Think of the havoc that would ensue if this was possible; every virus writer, hacker, and Q&A dummy would be releasing programs that blocked PC systems. You could, however, use the Windows ExitWindowsEx()[^] function, but that would mean writing some C code, and it would still be difficult to force the application to start without some form of service to control it.

                  Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                  F Offline
                  F Offline
                  flashery
                  wrote on last edited by
                  #15

                  Yeah that's what I am afraid of using just pop up dialog. I think it much better if I am going to make full screen window with matching some keyboard disabled such as alt+tab, alt+escape and any other keyboard shortcut that will switch window to window. I think it is much better? How is it?

                  L 1 Reply Last reply
                  0
                  • F flashery

                    Yeah that's what I am afraid of using just pop up dialog. I think it much better if I am going to make full screen window with matching some keyboard disabled such as alt+tab, alt+escape and any other keyboard shortcut that will switch window to window. I think it is much better? How is it?

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #16

                    I am not sure that you can disable some of the system key combinations in this way. I do think that you should forget Java as it is really not designed for this purpose when running on a Windows system. One of the basic rules of Windows is that the user is in charge, so it is quite difficult to find ways to override this.

                    Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                    F 1 Reply Last reply
                    0
                    • L Lost User

                      I am not sure that you can disable some of the system key combinations in this way. I do think that you should forget Java as it is really not designed for this purpose when running on a Windows system. One of the basic rules of Windows is that the user is in charge, so it is quite difficult to find ways to override this.

                      Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                      F Offline
                      F Offline
                      flashery
                      wrote on last edited by
                      #17

                      So as a conclusion I really need to convert in C++? I just want to sure before giving it a go..

                      L 1 Reply Last reply
                      0
                      • F flashery

                        So as a conclusion I really need to convert in C++? I just want to sure before giving it a go..

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #18

                        1. I do not think there is any way you can do this in Java. 2. There may be a way in C++ but no guarantees. You really need to ask yourself whether it is worth investing time and effort into this, or is there an easier (non-automatic) way to manage it.

                        Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                        F 1 Reply Last reply
                        0
                        • L Lost User

                          1. I do not think there is any way you can do this in Java. 2. There may be a way in C++ but no guarantees. You really need to ask yourself whether it is worth investing time and effort into this, or is there an easier (non-automatic) way to manage it.

                          Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                          F Offline
                          F Offline
                          flashery
                          wrote on last edited by
                          #19

                          Ok... I am really thankful of all your help guys. GOD BLESS YOU ALL.

                          1 Reply Last reply
                          0
                          • F flashery

                            How can I disable my Window 7 Desktop in Java while showing some warning? I am making a Timer program in java and need to disable the desktop if the time is over and enable again if the admin allows it. I just want to know the keyword of disabling and enabling the desktop. Just like this To shutdown a PC = shutdown -s Any help is appreciated. :) :)

                            L Offline
                            L Offline
                            LaxmikantYadav
                            wrote on last edited by
                            #20

                            You can use BlockInput() win32 API and call it in java using JNI. It will block the all input events of the system. :)

                            F P 2 Replies Last reply
                            0
                            • F flashery

                              Yeah that's what I am afraid of using just pop up dialog. I think it much better if I am going to make full screen window with matching some keyboard disabled such as alt+tab, alt+escape and any other keyboard shortcut that will switch window to window. I think it is much better? How was it?

                              T Offline
                              T Offline
                              TorstenH
                              wrote on last edited by
                              #21

                              you can't do more than that. You don't know the other applications and have no complete control over the OS. Why should the user not be allowed to use other applications? You're talking about a timer, what should the user do when the timer runs?

                              regards Torsten I never finish anyth...

                              1 Reply Last reply
                              0
                              • L LaxmikantYadav

                                You can use BlockInput() win32 API and call it in java using JNI. It will block the all input events of the system. :)

                                F Offline
                                F Offline
                                flashery
                                wrote on last edited by
                                #22

                                Wow let me try this solution.

                                1 Reply Last reply
                                0
                                • L LaxmikantYadav

                                  You can use BlockInput() win32 API and call it in java using JNI. It will block the all input events of the system. :)

                                  P Offline
                                  P Offline
                                  Peter_in_2780
                                  wrote on last edited by
                                  #23

                                  Laxmikant_Yadav wrote:

                                  It will block the all input events of the system.

                                  MSDN says otherwise. Ctrl-Alt-Del still works, so the user could get into task manager and kill the blocking app. Peter

                                  Software rusts. Simon Stephenson, ca 1994.

                                  L 1 Reply Last reply
                                  0
                                  • P Peter_in_2780

                                    Laxmikant_Yadav wrote:

                                    It will block the all input events of the system.

                                    MSDN says otherwise. Ctrl-Alt-Del still works, so the user could get into task manager and kill the blocking app. Peter

                                    Software rusts. Simon Stephenson, ca 1994.

                                    L Offline
                                    L Offline
                                    LaxmikantYadav
                                    wrote on last edited by
                                    #24

                                    Thanks for sharing this.

                                    1 Reply Last reply
                                    0
                                    • F flashery

                                      Yeah that's what I am afraid of using just pop up dialog. I think it much better if I am going to make full screen window with matching some keyboard disabled such as alt+tab, alt+escape and any other keyboard shortcut that will switch window to window. I think it is much better? How was it?

                                      J Offline
                                      J Offline
                                      jschell
                                      wrote on last edited by
                                      #25

                                      flashery wrote:

                                      think it much better if I am going to make full screen window with matching some keyboard disabled such as alt+tab, alt+escape and any other keyboard shortcut that will switch window to window.

                                      And AGAIN...you need to research 'kiosk'. And AGAIN...you cannot do all of that in java. So your choices are 1. Research all of the problems and then implement solutions with the understanding that some of the implementation will not be in java. 2. Go forward knowing that you cannot accomplish that in java. And as such a full screen display is going to be good enough.

                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • World
                                      • Users
                                      • Groups