Claude Azoulai
Messages postés26Date d'inscriptionmercredi 11 août 2004StatutMembreDernière intervention13 avril 2013
-
22 janv. 2009 à 18:07
PCPT
Messages postés13280Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 2018
-
22 janv. 2009 à 18:48
Bonjour à tous
Je développe une application que je voudrais lancer automatiquement au démarrage.
J'ai lu sur ce forum qu'il suffisait de placer un raccourci dans le dossier "démarrage" ou "startup" du répertoire Windows, hors je ne les ai pas trouvé.
Je suis sous Windows XP pro.
Private Declare Function RegOpenKey Lib
"advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As
String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib
"advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function
RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long,
ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long,
lpData As Any, ByVal cbData As Long) As Long
Sub RunOnStart(ByVal Libele
As String, ByVal Fichier As String)
Dim hKey As Long
RegOpenKey
&H80000001, "Software\Microsoft\Windows\CurrentVersion\Run", hKey
RegSetValueEx hKey, Libele, 0, 1, ByVal Fichier, Len(Fichier)
RegCloseKey
hKey
End Sub
' ==== Utilisation :
' Call
RunOnStart("Calc.exe","c:\Windows\calc.exe")
'
++
Prenez un instant pour répondre à [sujet-SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp