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. C#
  4. disable task manager when called....

disable task manager when called....

Scheduled Pinned Locked Moved C#
help
29 Posts 12 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.
  • M Mubeen asim

    hellu... i got this codes from microsoft to capture when a key is pressed... i have modified to disable the task manager being called but it dowsnt work.... sohuld i have to tweak the code more.. plz help me.. protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { const int WM_KEYDOWN = 0x100; const int WM_SYSKEYDOWN = 0x104; if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) { switch (keyData) { //looking for the task manager combination case Keys.Control|Keys.Alt|Keys.Delete: MessageBox.Show("task manager called."); break; } } return base.ProcessCmdKey(ref msg, keyData); }

    D Offline
    D Offline
    Dave Kreskowiak
    wrote on last edited by
    #4

    Your code won't work. And, you're only attempting to stop one method of launching TaskManager. Other methods include launching it from the Ctrl-Alt-Del screen, starting it from a CMD prompt, starting it from the Start/Run box, writing a small script to launch it, ... and so on... In short, you shouldn't even be trying to do this in a legitimate application.

    A guide to posting questions on CodeProject[^]
    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
         2006, 2007, 2008

    1 Reply Last reply
    0
    • M Mubeen asim

      hellu... i got this codes from microsoft to capture when a key is pressed... i have modified to disable the task manager being called but it dowsnt work.... sohuld i have to tweak the code more.. plz help me.. protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { const int WM_KEYDOWN = 0x100; const int WM_SYSKEYDOWN = 0x104; if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) { switch (keyData) { //looking for the task manager combination case Keys.Control|Keys.Alt|Keys.Delete: MessageBox.Show("task manager called."); break; } } return base.ProcessCmdKey(ref msg, keyData); }

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #5

      You can't capture the key combination alt+control+delete. It's handled by the system and never reaches your application.

      Despite everything, the person most likely to be fooling you next is yourself.

      M 1 Reply Last reply
      0
      • G Guffa

        You can't capture the key combination alt+control+delete. It's handled by the system and never reaches your application.

        Despite everything, the person most likely to be fooling you next is yourself.

        M Offline
        M Offline
        Mubeen asim
        wrote on last edited by
        #6

        hey you pple out threre.... i am not a hacker of some kind u think.... i am making a client program for the lab monitoring system where the student is given with a login screen and if the task manager is avaliable he would end my application so i was asking....and i have found way for disabling the task manager by capturing or by global hooking .... thans...

        C G 2 Replies Last reply
        0
        • K Kristian Sixhoj

          This question has been asked *several* times, and I can't see any reason for disabling the task manager. I don't think the end-user would be too pleased if their task manager got disabled. Why would you wanna do this?

          Kristian Sixhoej

          M Offline
          M Offline
          Mubeen asim
          wrote on last edited by
          #7

          hey you pple out threre.... i am not a hacker of some kind u think.... i am making a client program for the lab monitoring system where the student is given with a login screen and if the task manager is avaliable he would end my application so i was asking....and i have found way for disabling the task manager by capturing or by global hooking .... thans...

          1 Reply Last reply
          0
          • M Mubeen asim

            hey you pple out threre.... i am not a hacker of some kind u think.... i am making a client program for the lab monitoring system where the student is given with a login screen and if the task manager is avaliable he would end my application so i was asking....and i have found way for disabling the task manager by capturing or by global hooking .... thans...

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #8

            As we keep saying, disabling the task manager is done by group policy, if the lab doesn't want students to have access, they need to set this up, your code can't do it.

            Christian Graus Driven to the arms of OSX by Vista.

            A 1 Reply Last reply
            0
            • C Christian Graus

              As we keep saying, disabling the task manager is done by group policy, if the lab doesn't want students to have access, they need to set this up, your code can't do it.

              Christian Graus Driven to the arms of OSX by Vista.

              A Offline
              A Offline
              Anthony Mushrow
              wrote on last edited by
              #9

              I just thought, would a policy stop TSKILL from the command line?

              My current favourite word is: Delicious!

              -SK Genius

              Game Programming articles start -here[^]-

              C 1 Reply Last reply
              0
              • M Mubeen asim

                hey you pple out threre.... i am not a hacker of some kind u think.... i am making a client program for the lab monitoring system where the student is given with a login screen and if the task manager is avaliable he would end my application so i was asking....and i have found way for disabling the task manager by capturing or by global hooking .... thans...

                G Offline
                G Offline
                Guffa
                wrote on last edited by
                #10

                I didn't say anything at all about what I think that you are or not are. I only pointed out that it's impossible to capture the alt+control+delete key combination. What ever you are or not are, doesn't change this fact.

                Despite everything, the person most likely to be fooling you next is yourself.

                M 1 Reply Last reply
                0
                • G Guffa

                  I didn't say anything at all about what I think that you are or not are. I only pointed out that it's impossible to capture the alt+control+delete key combination. What ever you are or not are, doesn't change this fact.

                  Despite everything, the person most likely to be fooling you next is yourself.

                  M Offline
                  M Offline
                  Mubeen asim
                  wrote on last edited by
                  #11

                  how about using this for disabling the taskman..... impossible is nothin System.IO.File.Open("taskmgr.exe", FileMode.Open, FileAccess.ReadWrite, FileShare.None);

                  C D 2 Replies Last reply
                  0
                  • A Anthony Mushrow

                    I just thought, would a policy stop TSKILL from the command line?

                    My current favourite word is: Delicious!

                    -SK Genius

                    Game Programming articles start -here[^]-

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #12

                    A policy can also ban access to the command line, can't it ?

                    Christian Graus Driven to the arms of OSX by Vista.

                    A 1 Reply Last reply
                    0
                    • M Mubeen asim

                      how about using this for disabling the taskman..... impossible is nothin System.IO.File.Open("taskmgr.exe", FileMode.Open, FileAccess.ReadWrite, FileShare.None);

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #13

                      How does opening it disable it ?

                      Christian Graus Driven to the arms of OSX by Vista.

                      M 1 Reply Last reply
                      0
                      • C Christian Graus

                        How does opening it disable it ?

                        Christian Graus Driven to the arms of OSX by Vista.

                        M Offline
                        M Offline
                        Mubeen asim
                        wrote on last edited by
                        #14

                        modify the fileshare to grant total acess,,,

                        C 1 Reply Last reply
                        0
                        • C Christian Graus

                          A policy can also ban access to the command line, can't it ?

                          Christian Graus Driven to the arms of OSX by Vista.

                          A Offline
                          A Offline
                          Anthony Mushrow
                          wrote on last edited by
                          #15

                          Of course :doh:

                          My current favourite word is: Delicious!

                          -SK Genius

                          Game Programming articles start -here[^]-

                          1 Reply Last reply
                          0
                          • M Mubeen asim

                            modify the fileshare to grant total acess,,,

                            C Offline
                            C Offline
                            Christian Graus
                            wrote on last edited by
                            #16

                            It seems to me that you're kind of dense. As has been said, the ONLY way to totally block access, is with group policies. I can think of lots of other things you could try, but none of them are fool proof. So long as the student is not locked down on the PC, they will find a way around what you're trying to do. Such as, writing a program that finds the process and kills it, or using the command line to kill it ( as someone else said ). If this is homework, then stop going in circles, your teacher should know that what you're trying to do won't work. If it's a paid job, then tell the people you are robbing that they are just stupid enough to deserve to be working with you.

                            Christian Graus Driven to the arms of OSX by Vista.

                            M 1 Reply Last reply
                            0
                            • M Mubeen asim

                              how about using this for disabling the taskman..... impossible is nothin System.IO.File.Open("taskmgr.exe", FileMode.Open, FileAccess.ReadWrite, FileShare.None);

                              D Offline
                              D Offline
                              Daniel Grunwald
                              wrote on last edited by
                              #17

                              If you have ReadWrite access to taskmgr.exe, you're logged in as administrator. Administrators can do what they want with the system. You're just trying to make 'harmful' UI unavailable, but there's always a way around it. I've seen kiosk mode web browsers that tried to take the same approach. Usually all it takes to get around them is to browse to a PDF document, click Adobe's "Save" button, and in the Save As dialog, browse to "C:\windows\system32\cmd.exe" and right-click>Run. You'll never find ALL 'harmful' UI elements! What you really should do is disable harmful ACTIONS, not UI. Use group policy and disable task manager, the command line, etc. And don't log in as administrator: Administrators can do everything !

                              M 1 Reply Last reply
                              0
                              • C Christian Graus

                                It seems to me that you're kind of dense. As has been said, the ONLY way to totally block access, is with group policies. I can think of lots of other things you could try, but none of them are fool proof. So long as the student is not locked down on the PC, they will find a way around what you're trying to do. Such as, writing a program that finds the process and kills it, or using the command line to kill it ( as someone else said ). If this is homework, then stop going in circles, your teacher should know that what you're trying to do won't work. If it's a paid job, then tell the people you are robbing that they are just stupid enough to deserve to be working with you.

                                Christian Graus Driven to the arms of OSX by Vista.

                                M Offline
                                M Offline
                                Mubeen asim
                                wrote on last edited by
                                #18

                                i am dosing this work as a graduation project.... and i do have knowkedge that task manaver can be accessed sinply by renaming the System.IO.File.Open("renamed_taskmagr.exe".... but i should try some thing to help me in not ending my program by the task man at the start up by the student who should login and provide his information...

                                C 1 Reply Last reply
                                0
                                • D Daniel Grunwald

                                  If you have ReadWrite access to taskmgr.exe, you're logged in as administrator. Administrators can do what they want with the system. You're just trying to make 'harmful' UI unavailable, but there's always a way around it. I've seen kiosk mode web browsers that tried to take the same approach. Usually all it takes to get around them is to browse to a PDF document, click Adobe's "Save" button, and in the Save As dialog, browse to "C:\windows\system32\cmd.exe" and right-click>Run. You'll never find ALL 'harmful' UI elements! What you really should do is disable harmful ACTIONS, not UI. Use group policy and disable task manager, the command line, etc. And don't log in as administrator: Administrators can do everything !

                                  M Offline
                                  M Offline
                                  Mubeen asim
                                  wrote on last edited by
                                  #19

                                  thans but u are telling to block harmful actions not the programs... but i think it is easy to block the taskman rather than allowing it to open and then block it from ending my applications process..... if such code exists or if i could hide my applications process from the taskman like virus do then also it would be more complex code generation... so the KISS way.... block the taskmgr.exe....

                                  D P 2 Replies Last reply
                                  0
                                  • M Mubeen asim

                                    thans but u are telling to block harmful actions not the programs... but i think it is easy to block the taskman rather than allowing it to open and then block it from ending my applications process..... if such code exists or if i could hide my applications process from the taskman like virus do then also it would be more complex code generation... so the KISS way.... block the taskmgr.exe....

                                    D Offline
                                    D Offline
                                    Daniel Grunwald
                                    wrote on last edited by
                                    #20

                                    The KISS way is to open the group policy options and click on 'disable task manager'.

                                    M 1 Reply Last reply
                                    0
                                    • D Daniel Grunwald

                                      The KISS way is to open the group policy options and click on 'disable task manager'.

                                      M Offline
                                      M Offline
                                      Mubeen asim
                                      wrote on last edited by
                                      #21

                                      nice what does the KISS way tel about doing the same gpedit.msc way from c# code.. hope its simple....!

                                      1 Reply Last reply
                                      0
                                      • M Mubeen asim

                                        i am dosing this work as a graduation project.... and i do have knowkedge that task manaver can be accessed sinply by renaming the System.IO.File.Open("renamed_taskmagr.exe".... but i should try some thing to help me in not ending my program by the task man at the start up by the student who should login and provide his information...

                                        C Offline
                                        C Offline
                                        Christian Graus
                                        wrote on last edited by
                                        #22

                                        max.4u wrote:

                                        but i should try some thing to help me in not ending my program by the task man at the start up by the student who should login and provide his information...

                                        If you want to do *something*, write a service that checks if the application has closed, and re-opens it. That might make your teacher happy, but if he's not a moron, he'll know that whatever you do, was a waste of time, it's not the place to try to enforce what you want. Overall, you are wasting a lot of time on something really stupid. If your teacher did not ask you to do this, then stop wasting your time, as you've been told over and over, you can't do it this way, not in a foolproof way.

                                        Christian Graus Driven to the arms of OSX by Vista.

                                        1 Reply Last reply
                                        0
                                        • M Mubeen asim

                                          thans but u are telling to block harmful actions not the programs... but i think it is easy to block the taskman rather than allowing it to open and then block it from ending my applications process..... if such code exists or if i could hide my applications process from the taskman like virus do then also it would be more complex code generation... so the KISS way.... block the taskmgr.exe....

                                          P Offline
                                          P Offline
                                          Pete OHanlon
                                          wrote on last edited by
                                          #23

                                          All right. If you're so bloody clever figure out the code for yourself. You've been told by several experts that the way to do this is to use policies to cope with it, and yet you persist in arguing. Fine - write the code, post it up and then see how long it is before somebody finds a way to work round it (btw - somebody could rename tastmanager.exe and launch that so any approach you had to block it by name would fail).

                                          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                                          My blog | My articles | MoXAML PowerToys

                                          M 2 Replies 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