Results 1 to 5 of 5

Thread: Finding out if Windows is shutting down

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Posts
    162

    Arrow Finding out if Windows is shutting down

    is there anyway to find out if windows is shutting down and get some code to run. I'm having a few problems with temp internet files so I need these deleting when windows is shutting down. It will be running on an app that will already be loaded. Any ideas?

  2. #2
    Si_the_geek
    Guest
    That sound really complicated (if at all possible). You'd probably need to do lots of hooking into the system, which is a complete nightmare!

    it would be much easier to just have a program that does it on startup instead...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Posts
    162
    the problem with having it at startup is i wouldnt be able to log in, because the roaming profiles are refusing to load due to corrupt temp internet files.

    Its win2k btw so for_unloadquery wotsit dosnt work in my app for some reason tho it does work in a new app.

  4. #4
    Red Rush-In
    Guest
    Not hard at all.

    VB Code:
    1. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    2.    
    3.     If UnloadMode = vbAppWindows Then
    4.         'Windows is shutting down!
    5.     End If
    6.  
    7. End Sub

    UnloadMode tells us why the program is shutting down. If you set cancel to true you can even keep earlier versions of windows from shutting down.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Posts
    162

    Arrow

    For some reason i cant get this to work with win2k (read earlier post) any ideas?

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