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. Visual Basic
  4. Unable to proper shutdown

Unable to proper shutdown

Scheduled Pinned Locked Moved Visual Basic
windows-adminhelptutorial
5 Posts 3 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.
  • G Offline
    G Offline
    Gagan 20
    wrote on last edited by
    #1

    Hi all... I have created a program that checks system's processor's ID and some registry keys before starting. After that it works in background. The problem is here that when the program is in execution and I am trying to shutdown my system then my system is not shutting down and the problem is that Windows is unable to kill my program's execution forcefully or something like that. How to solve this problem, suggest me. Thanks. Gagan

    L F 2 Replies Last reply
    0
    • G Gagan 20

      Hi all... I have created a program that checks system's processor's ID and some registry keys before starting. After that it works in background. The problem is here that when the program is in execution and I am trying to shutdown my system then my system is not shutting down and the problem is that Windows is unable to kill my program's execution forcefully or something like that. How to solve this problem, suggest me. Thanks. Gagan

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      did you do anything special to get that? is your app windowless? maybe SystemEvents.SessionEnding could help you out. :)

      Luc Pattyn


      I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


      G 1 Reply Last reply
      0
      • L Luc Pattyn

        did you do anything special to get that? is your app windowless? maybe SystemEvents.SessionEnding could help you out. :)

        Luc Pattyn


        I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


        G Offline
        G Offline
        Gagan 20
        wrote on last edited by
        #3

        Well, I am getting processor's ID by importing System.management namespace and bye creating objects of ManagementObject and ManagementObjectSearcher and getting registry keys by using my.computer.registry class. Could you explain me your solution or do you have any piece of code? Thanks. Gagan

        L 1 Reply Last reply
        0
        • G Gagan 20

          Well, I am getting processor's ID by importing System.management namespace and bye creating objects of ManagementObject and ManagementObjectSearcher and getting registry keys by using my.computer.registry class. Could you explain me your solution or do you have any piece of code? Thanks. Gagan

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          use Google to research; you might find things like this[^]. :|

          Luc Pattyn


          I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


          1 Reply Last reply
          0
          • G Gagan 20

            Hi all... I have created a program that checks system's processor's ID and some registry keys before starting. After that it works in background. The problem is here that when the program is in execution and I am trying to shutdown my system then my system is not shutting down and the problem is that Windows is unable to kill my program's execution forcefully or something like that. How to solve this problem, suggest me. Thanks. Gagan

            F Offline
            F Offline
            freakyit
            wrote on last edited by
            #5

            hi man, sounds like you have override the OnClosing / OnClose functions. And in there you set the EventArgs.Cancel to true?!? if you do this you need to check the CancelEventArguments for a CloseReason. in that case cast the CancelEventArgs to FormClosingEventArgs and check the Property CloseReason for CloseReason.WindowsShutdow,etc.. before setting args.Cancel to true. hope i could help :) bless

            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