Results 1 to 4 of 4

Thread: kill the program

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2000
    Posts
    157
    how do i kill a program when the user has finished using it.

    i have a button exit program, which has unload me
    but when i install the program on my computer and then run it, i still have the program running in the background, the only way to kill it is ctrl alt and del and then shut the program from there

  2. #2
    Addicted Member Nice's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    144

    Red face

    That's not normal. Do u use any automation in ur project? Sometimes processes created from within ur application do not stop the running app. Check to see all objects or processes are destroyed before u unload the app.

  3. #3
    Guest
    If you have a hidden form somewhere it will also keep your program running...

    Basically anything that can receive events from the OS will keep it running, except for a code-only timer and the likes, they will crash it when your programs stops without killing the timer, but that's off-topic.

    Gerco.

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Me is a vb keyword to reference the current form.
    So using unload me isn't exiting any add-ins, modules etc, just the current form.

    For a 1 form program :
    Code:
    Unload me
    Set me = nothing
    End
    For all other programs :
    Code:
    Dim Frm as form
    
    For each Frm In forms
       Unload Frm
       Set Frm = nothing
    Next Frm
    
    End
    See this tip too ... http://www.vb-world.net/tips/tip53.html

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width