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. Determine if Windows is shutting down

Determine if Windows is shutting down

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 4 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.
  • W Offline
    W Offline
    Werries
    wrote on last edited by
    #1

    Hi there, Is there a way to determine if windows are shutting down in a VB application? Thanks, Werries

    A programmer's life is good... or is it?? Ek dink nie so nie!

    T L S 3 Replies Last reply
    0
    • W Werries

      Hi there, Is there a way to determine if windows are shutting down in a VB application? Thanks, Werries

      A programmer's life is good... or is it?? Ek dink nie so nie!

      T Offline
      T Offline
      The ANZAC
      wrote on last edited by
      #2

      i believe windows executes a batch file to initialise shutdown sequence, perhaps you could use the filewatcher to monitor this file for changes, then if something happens with it, check if the shutdown process in is started through system.diagnostics.process.

      Posted by The ANZAC : "WWBD, What Would Buffy Do?" : "I don't know man, she's stronger than me"

      1 Reply Last reply
      0
      • W Werries

        Hi there, Is there a way to determine if windows are shutting down in a VB application? Thanks, Werries

        A programmer's life is good... or is it?? Ek dink nie so nie!

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

        Have a look at SystemEvents class. :)

        Luc Pattyn [My Articles] [Forum Guidelines]

        1 Reply Last reply
        0
        • W Werries

          Hi there, Is there a way to determine if windows are shutting down in a VB application? Thanks, Werries

          A programmer's life is good... or is it?? Ek dink nie so nie!

          S Offline
          S Offline
          saeed_rezaei
          wrote on last edited by
          #4

          hi you can use ghedit.msc and scrip to determine when windows are shutting down. goto : Run -> gpedit.msc -> computer configuration -> windows setting -> scripts ->shutdown. and then add your vb script that you want to run at shutdown.

          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