If I want to run my application automatic when the windows starts.
(like the clock,volume....)
But I don't to use API.
How could I do?
Thanks.....
Printable View
If I want to run my application automatic when the windows starts.
(like the clock,volume....)
But I don't to use API.
How could I do?
Thanks.....
Choices:
- Place an entry (String) in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. e.g. MyApp with value being the path to your application
- Place a shortcut to your application in the startup folder.
Dam Right!!!!:D :D :p
And that means? :confused:Quote:
Originally posted by BodwadUK
Dam Right!!!!:D :D :p
But , how could I code the program?
I don't want to set it by human.....
I mean the application can set the function by itself.
Thats How You Do It Copy A ShortCut into The Startup Folder Under Start/Programs
Code It As Normal
Itself???
do u mean like installing it?
Thank everyone.
I am ok!
Could you tell me what is shortcut?
Mr.axion_sa:
Could you explain your method detailed?
Thank you very much....
If someone know how to do the method,
please help me , I don't know how to do .....
Thanks...........
The code I'd use if VB6 was used:
VB Code:
Private Declare Function fCreateShellLink Lib "VB5STKIT.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long Private Sub Form_Load() 'KPD-Team 1999 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] ' -> code by Raist Lin 'Create a shell link on your desktop lngresult = fCreateShellLink("..\..\Desktop", "LINK", "C:\myfile.exe", "") End Sub
But, you're using .Net - there should be a .Net equivalent hiding somewhere
errr, if you are using the registry then I see no reason to aviod API's (how can you do this with an API?:D)
umm if you want to do what axion_sa said:
VB Code:
Imports Microsoft.Win32 Private Sub AddToRun(ByVal appPath As String, ByVal appTitle As String) ' I used CreateSubKey instead of OpenSubKey. It looks like that not all machines have a Run folder :D Dim regRun As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Run") regRun.SetValue(appTitle, appPath) regRun.Close() End Sub
This will add the key to that part of the registry, but I havent tested to see if it works... so you call it like this
AddToRun (APPLICATION'S EXECUTABLE PATH, "My Application Title!")
Thank all of the people who help me....
I am successful.
My English is very bad, because I am not a American.
Now I share my method.
I use a method about registry.
when I make a Windows Installer
then you can set the registry.
just set the
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" and your application infromation about regetry
(it is on the left of screen)
Thanks everyone again!