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. how to detect that a process is being close by a task manager

how to detect that a process is being close by a task manager

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
3 Posts 2 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.
  • C Offline
    C Offline
    carl_sti
    wrote on last edited by
    #1

    is there any way to identify that the process is being close by task manager? (not in the application tab but in the process tab) im using the formclosed event of the form but it doest work.. Private Sub frmMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed Select Case e.CloseReason Case CloseReason.ApplicationExitCall MsgBox("Notify") Case CloseReason.FormOwnerClosing MsgBox("Notify") Case CloseReason.MdiFormClosing MsgBox("Notify") Case CloseReason.None MsgBox("Notify") Case CloseReason.TaskManagerClosing MsgBox("Notify") Case CloseReason.UserClosing MsgBox("Notify") Case CloseReason.WindowsShutDown MsgBox("Notify") End Select but it doesnt work when i closed the form in process tab(Task Manager).. :confused: -- modified at 1:57 Thursday 14th December, 2006

    D 2 Replies Last reply
    0
    • C carl_sti

      is there any way to identify that the process is being close by task manager? (not in the application tab but in the process tab) im using the formclosed event of the form but it doest work.. Private Sub frmMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed Select Case e.CloseReason Case CloseReason.ApplicationExitCall MsgBox("Notify") Case CloseReason.FormOwnerClosing MsgBox("Notify") Case CloseReason.MdiFormClosing MsgBox("Notify") Case CloseReason.None MsgBox("Notify") Case CloseReason.TaskManagerClosing MsgBox("Notify") Case CloseReason.UserClosing MsgBox("Notify") Case CloseReason.WindowsShutDown MsgBox("Notify") End Select but it doesnt work when i closed the form in process tab(Task Manager).. :confused: -- modified at 1:57 Thursday 14th December, 2006

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

      There are a few different methods TaskManager TRIES on the Applications tab before doing the brute force "halt execution and free the memory" method. This last-ditch method is what the Processes tab uses when it "kills" a process. It isn't detectable by your code since your process ceases to execute when TaskManager obliterates the Process using this method.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      1 Reply Last reply
      0
      • C carl_sti

        is there any way to identify that the process is being close by task manager? (not in the application tab but in the process tab) im using the formclosed event of the form but it doest work.. Private Sub frmMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed Select Case e.CloseReason Case CloseReason.ApplicationExitCall MsgBox("Notify") Case CloseReason.FormOwnerClosing MsgBox("Notify") Case CloseReason.MdiFormClosing MsgBox("Notify") Case CloseReason.None MsgBox("Notify") Case CloseReason.TaskManagerClosing MsgBox("Notify") Case CloseReason.UserClosing MsgBox("Notify") Case CloseReason.WindowsShutDown MsgBox("Notify") End Select but it doesnt work when i closed the form in process tab(Task Manager).. :confused: -- modified at 1:57 Thursday 14th December, 2006

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

        No, there isn't. You code STOPS executing, immediately. You don't have any way of detecting this if your no longer running.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        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