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. Problem shutting windows when thread running!!!

Problem shutting windows when thread running!!!

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelpquestion
4 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.
  • K Offline
    K Offline
    kmuthuk
    wrote on last edited by
    #1

    Hi, I have a problem in shutting windows down when my thread is running. I am able to shut windows down after I stopped my thread. I am using VS 2003 C#, and this is happening in Windows application. What could be the problem? Could anyone hlep get rid of this? Thanks in advance. Muthu.

    N 1 Reply Last reply
    0
    • K kmuthuk

      Hi, I have a problem in shutting windows down when my thread is running. I am able to shut windows down after I stopped my thread. I am using VS 2003 C#, and this is happening in Windows application. What could be the problem? Could anyone hlep get rid of this? Thanks in advance. Muthu.

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Sure! As long as your thread is running, windows will keep waiting for it to end, or it will give you the choice to forcefully "end task". Another more graceful way is to set MyThread.IsBackground = true. This way it will automatically end when all other foreground threads of your program end.

      Regards:rose:

      K 1 Reply Last reply
      0
      • N Nader Elshehabi

        Sure! As long as your thread is running, windows will keep waiting for it to end, or it will give you the choice to forcefully "end task". Another more graceful way is to set MyThread.IsBackground = true. This way it will automatically end when all other foreground threads of your program end.

        Regards:rose:

        K Offline
        K Offline
        kmuthuk
        wrote on last edited by
        #3

        Thanks. MyThread is a Background thread. i.e. MyThread.IsBackground = true; But still it prevents me from shutting down windows. Muthu.

        N 1 Reply Last reply
        0
        • K kmuthuk

          Thanks. MyThread is a Background thread. i.e. MyThread.IsBackground = true; But still it prevents me from shutting down windows. Muthu.

          N Offline
          N Offline
          Nader Elshehabi
          wrote on last edited by
          #4

          That's really wiered!! Are you sure there are no other foreground threads active beside that one? Also does your thread keep running after your closed your program normally?

          Regards:rose:

          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