Results 1 to 9 of 9

Thread: Shut Down

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Seattle, WA, USA
    Posts
    46

    Post

    Hi,

    I am writing a program that runs hidden in the background. My only problem is that when I run it, and then shut down or restart windows 98 se, it will not close it. It makes me close it after it says that it is not responding. How do I make it shut down automatically, when windows shuts down??


    Thanks,


    Kevin

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    I think you'll have to subclass and handle the message for Windows shutdown (look it up in MSDN). I can't think of another way off the top of me head
    buzzwords are the language of fools

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Seattle, WA, USA
    Posts
    46

    Post

    Thanks,

    But that site on Microsoft no longer is there. They want you to buy some software. Is there any other way to find this info.??

    Thanks,

    Kevin

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Post Microsoft Online Library

    You can always refer to the Microsoft Online Library at >> http://msdn.microsoft.com/isapi/msdn...m/hh1start.htm


  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Seattle, WA, USA
    Posts
    46

    Post

    Hi,

    I still can not find it there. Any other ways I can find this info. This is killing me.


    Thank,

    Kevin

  6. #6
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Post

    If your app has a form, you could use the QueryUnload event to find out when windows is closing.
    Code:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        If UnloadMode = vbAppWindows Then
            Unload Me   'or whatever needed to close the app
        End If
    End Sub

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Seattle, WA, USA
    Posts
    46

    Post

    Hi,

    My app does not have a form on a module. Will this still work??


    Thanks,

    Kevin

  8. #8
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    Put in a form , and hide it at startup:
    me.hide
    buzzwords are the language of fools

  9. #9

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Seattle, WA, USA
    Posts
    46

    Post

    Hi,


    I tried it in a form and then my program would not run. So, I put it in a module, and I am using Sub Main() and it works. Is there a Equivalent to Sub Form_Unload for Sub Main(). Also, unload.me will not work, and End will not either. What code do I enter to close the module??


    Thaks,

    Kevin

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