|
-
May 4th, 2000, 10:35 PM
#1
Thread Starter
Fanatic Member
Could someone remind me what the key is for running an app on startup, and is it possible to do the same thing on shutdown?- CHEEEEEEEERS.
-
May 4th, 2000, 10:53 PM
#2
Hyperactive Member
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
That one you mean?
-
May 4th, 2000, 11:45 PM
#3
Thread Starter
Fanatic Member
Erm, dunno Judd. I was thinking I might put the name of the file I want to run in somewhere. Can I do this on Startup and Shutdown?
-
May 4th, 2000, 11:59 PM
#4
Hyperactive Member
For startup to run the program once (i.e. only on the next restart) use the Key I already gave.
To run on startup everytime use
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
(Have a look there and you'll see what you need to enter)
I don't know about shutdown....

Dan
-
May 5th, 2000, 12:49 AM
#5
Addicted Member
If you want your app to run at shut down the only way I know is to make it into a TSR. This means that after you run your program (at startup or whenever) and it is done doing what you need it to do you hide it/minimize it/put an icon in the System Tray/whatever. In your code you put the tasks you want handle when Windows shuts down in the QueryUnload event, as follows:
Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbAppWindows Then
MsgBox "Current Windows session ending."
Cancel = True
Call YourWindowsShutRoutine
End If
End Sub
I hope you get what I'm saying, if not I'll be happy to elaborate.
Dan PM
Analyst Programmer
VB6 SP3 (also VB4 16-bit sometimes  )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|