begin process at 2012 02 16 15:17:00
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Modules

 > AJOUTER VOTRE APPLI DANS LE MENU DÉMARRER

AJOUTER VOTRE APPLI DANS LE MENU DÉMARRER


 Information sur la source

Note :
4,33 / 10 - par 3 personnes
4,33 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Modules Classé sous :application, démarrer, menu Niveau :Débutant Date de création :03/09/2001 Vu :4 750

Auteur : Alex001

Ecrire un message privé
Site perso
Commentaire sur cette source (3)
Ajouter un commentaire et/ou une note

 Description

tous est dans le titre, aussi ce code je l'es trouver dans www.planet-code-source.com.
Si je vous l'es copier c'est parceque moi je copie mon exe à l'install quand je distribue mon appli , là ce qui es interressant c'est le module.

                         @+

Source

  • 'A inserrer dans un module
  • Option Explicit
  • 'Add Your Application To The Startup Directory
  • 'Programmed By: Source
  • 'Decs Taken From MiscCoding
  • 'www.vbfx.net
  • 'www.terrorfx.com/~source
  • 'itzdasource@aol.com
  • Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  • Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
  • Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
  • Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  • Public Const MOUSEEVENTF_LEFTDOWN = &H2
  • Public Const MOUSEEVENTF_LEFTUP = &H4
  • Public Const MOUSEEVENTF_MIDDLEDOWN = &H20
  • Public Const MOUSEEVENTF_MIDDLEUP = &H40
  • Public Const MOUSEEVENTF_RIGHTDOWN = &H8
  • Public Const MOUSEEVENTF_RIGHTUP = &H10
  • Public Const MOUSEEVENTF_MOVE = &H1
  • Declare Function ShowCursor& Lib "user32" (ByVal bShow As Long)
  • Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRECT As RECT) As Long
  • Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRECT As RECT) As Long
  • Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
  • Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  • Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
  • Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
  • Public Const RGN_AND = 1
  • Public Const RGN_COPY = 5
  • Public Const RGN_DIFF = 4
  • Public Const RGN_OR = 2
  • Public Const RGN_XOR = 3
  • Type POINTAPI
  • X As Long
  • Y As Long
  • End Type
  • Type RECT
  • Left As Long
  • Top As Long
  • Right As Long
  • Bottom As Long
  • End Type
  • Declare Function ExitWindows Lib "User" (ByVal dwReturnCode As Long, ByVal uReserved As Integer) As Integer
  • Global Const EW_REBOOTSYSTEM = &H43
  • Global Const EW_RESTARTWINDOWS = &H42
  • Global Const EW_EXITWINDOWS = 0
  • Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  • Public Const HWND_NOTOPMOST = -2
  • Public Const HWND_TOPMOST = -1
  • Public Const SWP_NOMOVE = &H2
  • Public Const SWP_NOSIZE = &H1
  • Public Const Flags = SWP_NOMOVE Or SWP_NOSIZE
  • Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
  • Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
  • Private Const SPI_SCREENSAVERRUNNING = 97
  • Type SECURITY_ATTRIBUTES
  • nLength As Long
  • lpSecurityDescriptor As Long
  • bInheritHandle As Boolean
  • End Type
  • Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal szData As String, ByVal cbData As Long) As Long
  • Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  • Declare Function RegCreateKeyEx Lib "advapi32" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long
  • Private Type icmp_echo_reply
  • Address As Long
  • Status As Long
  • RoundTripTime As Long
  • DataSize As Integer
  • Reserved As Integer
  • DataPointer As Long
  • Data As String * 250
  • End Type
  • Private Declare Function IcmpCreateFile Lib "icmp.dll" () As Long
  • Private Declare Function IcmpCloseHandle Lib "icmp.dll" (ByVal IcmpHandle As Long) As Long
  • Private Const PING_TIMEOUT = 200
  • Private Const WSADESCRIPTION_LEN = 256
  • Private Const WSASYSSTATUS_LEN = 256
  • Private Const WSADESCRIPTION_LEN_1 = WSADESCRIPTION_LEN + 1
  • Private Const WSASYSSTATUS_LEN_1 = WSASYSSTATUS_LEN + 1
  • Private Const SOCKET_ERROR = -1
  • Private Type tagWSAData
  • wVersion As Integer
  • wHighVersion As Integer
  • szDescription As String * WSADESCRIPTION_LEN_1
  • szSystemStatus As String * WSASYSSTATUS_LEN_1
  • iMaxSockets As Integer
  • iMaxUdpDg As Integer
  • lpVendorInfo As String * 200
  • End Type
  • Private Declare Function WSAStartup Lib "wsock32" (ByVal wVersionRequested As Integer, lpWSAData As tagWSAData) As Integer
  • Private Declare Function WSACleanup Lib "wsock32" () As Integer
  • Public Sub AddToStartupDir()
  • 'Add your application to the windows startup folder
  • 'Simply call this function and it does the rest using Encoded VB code like App.*
  • 'Call AddToStartupDir
  • On Error GoTo error
  • FileCopy App.Path & "\" & App.EXEName & ".EXE", Mid$(App.Path, 1, 3) & "WINDOWS\START MENU\PROGRAMS\STARTUP\" & App.EXEName & ".EXE"
  • Exit Sub
  • error: MsgBox Err.Description, vbExclamation, "Error"
  • End Sub
  • Public Sub DeleteFile(FilePath As String)
  • 'Misc Sub I Added
  • 'Delete a file
  • 'Remove your pws???
  • 'Call DeleteFile ("c:\windows\test.exe")
  • On Error GoTo error
  • Kill FilePath$
  • Exit Sub
  • error: MsgBox Err.Description, vbExclamation, "Error"
  • End Sub
  • Public Sub ExecuteFile(FilePath As String)
  • 'Misc Sub I Added
  • 'Execute a file
  • 'Run Your Program
  • 'Call ExecuteFile("c:\test.exe")
  • Dim ret
  • On Error GoTo error
  • ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & (FilePath))
  • Exit Sub
  • error: MsgBox Err.Description, vbExclamation, "Error"
  • End Sub
  • Public Sub ExecuteNewProgram()
  • 'Misc Sub I Added
  • 'This will execute the program over again, creating two working copies
  • 'Call ExecuteNewProgram
  • Dim ret
  • On Error GoTo error
  • ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & App.Path & "\" & App.EXEName & ".EXE")
  • Exit Sub
  • error: MsgBox Err.Description, vbExclamation, "Error"
  • End Sub
  • 'Dans un objet
  • Private Sub Command1_Click()
  • Call AddToStartupDir
  • End Sub
  • Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  • 'when the mouse is hovered over command1 button....changes label3s caption
  • Label3.Caption = "This will Add Your App's .EXE to StartUp"
  • End Sub
  • Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  • Label3.Caption = "status"
  • End Sub
  • Private Sub Label2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  • Label3.Caption = "status"
  • End Sub
'A inserrer dans un module


Option Explicit
'Add Your Application To The Startup Directory
'Programmed By: Source
'Decs Taken From MiscCoding
'www.vbfx.net
'www.terrorfx.com/~source
'itzdasource@aol.com
Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Public Const MOUSEEVENTF_MIDDLEDOWN = &H20
Public Const MOUSEEVENTF_MIDDLEUP = &H40
Public Const MOUSEEVENTF_RIGHTDOWN = &H8
Public Const MOUSEEVENTF_RIGHTUP = &H10
Public Const MOUSEEVENTF_MOVE = &H1
Declare Function ShowCursor& Lib "user32" (ByVal bShow As Long)
Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRECT As RECT) As Long
Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRECT As RECT) As Long
Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Public Const RGN_AND = 1
Public Const RGN_COPY = 5
Public Const RGN_DIFF = 4
Public Const RGN_OR = 2
Public Const RGN_XOR = 3
Type POINTAPI
X As Long
Y As Long
End Type
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Declare Function ExitWindows Lib "User" (ByVal dwReturnCode As Long, ByVal uReserved As Integer) As Integer
Global Const EW_REBOOTSYSTEM = &H43
Global Const EW_RESTARTWINDOWS = &H42
Global Const EW_EXITWINDOWS = 0
Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const HWND_NOTOPMOST = -2
Public Const HWND_TOPMOST = -1
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const Flags = SWP_NOMOVE Or SWP_NOSIZE
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Const SPI_SCREENSAVERRUNNING = 97
Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Boolean
End Type
Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal szData As String, ByVal cbData As Long) As Long
Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
Declare Function RegCreateKeyEx Lib "advapi32" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long
Private Type icmp_echo_reply
Address         As Long
Status          As Long
RoundTripTime   As Long
DataSize        As Integer
Reserved        As Integer
DataPointer     As Long

Data            As String * 250
End Type
Private Declare Function IcmpCreateFile Lib "icmp.dll" () As Long
Private Declare Function IcmpCloseHandle Lib "icmp.dll" (ByVal IcmpHandle As Long) As Long
Private Const PING_TIMEOUT = 200
Private Const WSADESCRIPTION_LEN = 256
Private Const WSASYSSTATUS_LEN = 256
Private Const WSADESCRIPTION_LEN_1 = WSADESCRIPTION_LEN + 1
Private Const WSASYSSTATUS_LEN_1 = WSASYSSTATUS_LEN + 1
Private Const SOCKET_ERROR = -1
Private Type tagWSAData
wVersion            As Integer
wHighVersion        As Integer
szDescription       As String * WSADESCRIPTION_LEN_1
szSystemStatus      As String * WSASYSSTATUS_LEN_1
iMaxSockets         As Integer
iMaxUdpDg           As Integer
lpVendorInfo        As String * 200
End Type
Private Declare Function WSAStartup Lib "wsock32" (ByVal wVersionRequested As Integer, lpWSAData As tagWSAData) As Integer
Private Declare Function WSACleanup Lib "wsock32" () As Integer

Public Sub AddToStartupDir()
'Add your application to the windows startup folder
'Simply call this function and it does the rest using Encoded VB code like App.*
'Call AddToStartupDir
On Error GoTo error
FileCopy App.Path & "\" & App.EXEName & ".EXE", Mid$(App.Path, 1, 3) & "WINDOWS\START MENU\PROGRAMS\STARTUP\" & App.EXEName & ".EXE"
Exit Sub
error:  MsgBox Err.Description, vbExclamation, "Error"
End Sub


Public Sub DeleteFile(FilePath As String)
'Misc Sub I Added
'Delete a file
'Remove your pws???
'Call DeleteFile ("c:\windows\test.exe")
On Error GoTo error
Kill FilePath$
Exit Sub
error:  MsgBox Err.Description, vbExclamation, "Error"
End Sub

Public Sub ExecuteFile(FilePath As String)
'Misc Sub I Added
'Execute a file
'Run Your Program
'Call ExecuteFile("c:\test.exe")
Dim ret
On Error GoTo error
ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & (FilePath))
Exit Sub
error:  MsgBox Err.Description, vbExclamation, "Error"
End Sub
Public Sub ExecuteNewProgram()
'Misc Sub I Added
'This will execute the program over again, creating two working copies
'Call ExecuteNewProgram
Dim ret
On Error GoTo error
ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & App.Path & "\" & App.EXEName & ".EXE")
Exit Sub
error:  MsgBox Err.Description, vbExclamation, "Error"
End Sub


'Dans un objet 

Private Sub Command1_Click()
Call AddToStartupDir
End Sub

Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'when the mouse is hovered over command1 button....changes label3s caption
Label3.Caption = "This will Add Your App's .EXE to StartUp"
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label3.Caption = "status"
End Sub


Private Sub Label2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label3.Caption = "status"
End Sub
 

 Conclusion

Bonne prog. à tous .        ALEX001


 Sources du même auteur

Source avec Zip Source avec une capture CLONE ACDSEE
Source avec Zip NEO MODUS DIRECT CONNECT CLIENT CODE SOURCE EN VB6 (P2P)
Source avec Zip Source avec une capture AGENT MICROSOFT
Source avec une capture IMPRESSION D'INFORMATION SUR UNE FEUILLE FORMALISÉE
Source avec Zip Source avec une capture PRESSE-PAPIER

 Sources de la même categorie

Source avec Zip Source .NET (Dotnet) CRYPTAGE ET DECRYPTAGE par jerichez
Source avec Zip Source avec une capture Source .NET (Dotnet) EXEMPLE MODBUS POUR MODULES ADAM, BECKHOFF, WAGO par mnmsjaune
Source avec Zip Source .NET (Dotnet) CRÉER SON PROPRE DESIGNER COMME CELUI DE VISUAL STUDIO par ShareVB
Source avec Zip Source .NET (Dotnet) CONVERSION UTM VERS LAT/LONG par BarresLTD
Source avec Zip CPROPGROUP : COLLECTION FAITE MAISON par Flocreate

 Sources en rapport avec celle ci

Source avec Zip Source .NET (Dotnet) CRYPTAGE ET DECRYPTAGE par jerichez
Source .NET (Dotnet) VÉRIFIER SI UNE APPLICATION EST LANCÉ, SINON ON LA DÉMARRE ! par scoubigee
Source avec Zip LANCEUR MULTI AOL POUR WINDOWS 98 par sagitaire54
EFFACER LA LISTE DES DOCUMENTS RÉCENTS (DOSSIER DOCUMENTS DA... par vow
Source avec Zip INHIBER LA "RECHERCHE" DANS LE MENU DÉMARRER par sp@ce

Commentaires et avis

Commentaire de DuncanIdaho le 24/08/2002 13:11:01

:( sa fait que copier l'exe ds "WINDOWSSTART MENUPROGRAMSSTARTUP"... :(

Commentaire de adrienphp le 01/04/2003 22:18:43

Pomper sur le site msdn
note : 0/20

Commentaire de psymon stark le 17/05/2006 15:26:01

comme dirait BOD, c'est super compliqué, mais si quelqu'un pourrait faire pareil mais plutot qu'avec un exe, avec un vbs?

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Accéder au Menu Démarrer dans une application quelconque [ par Hypopotamus ] Comment, à travers une application Visual Basic, accéder au Menu Démarrer (simuler un clic sur le Bouton Démarrer en fait) ? Comment mettre une application dans le menu démarrer ? [ par barth707 ] Bonjour,je cherche à faire une application qui va démarrer toute seule (grace au menu démarrer dans tous les programmes). Je ne sais pas quel code uti Désactiver la touche Menu Démarrer [ par rudydeschamps ] Bonjour à tous,Je cherche le moyen de désactiver la touche du menu Démarrer (au moyen d'une API, base de registre ou autre).En fait, mon application s Addins Menu [ par Jyconaisrien ] Programmeur et programmeuse... Slt a tousVoila je bloc sur un truc alors j espere que vous pourrez m' aiderJe voudrai en fait ajouter des menus (liées Panneau de configuration [ par lebarn ] Bonjour à tous,Comment peut-on ouvrir la boîte de Déconnexion du Menu Démarrer, ouvrir le dossier Imprimantes, ouvrir la fenêtre "Barre des tâches et menu et barre outil sous excel [ par jraynald ] J?ai créé une petite application VBA sous excel, mais comment supprimer tous les menu et barre d?outils pour les remplacer par la suite par les mienne Comment lier les options du menu aux variables du programme [ par gko ] Salut à tous,mon problème se trouve au niveau de la conception de mon application: Mon application charge au démarrage des paramétres venant d'un fich Ajouter une barre graphique à un menu comme dans le menu démarrer [ par Yan ] Salut de nombreux programmes pros affichent dans les menus popups des barres à gauche comme le menu démarrer Windows 95/98J'ai sous les yeux un progra Treeview et les bases de données [ par Patrik ] Salut,Je vais vous expliquer en détails ce que je cherche à faire avec le treeview.J'ai une table access qui se nomme Menus : - 1er champ : NumMenu ( Actualisation du menu démarrer et du bureau windows [ par Antoine ] J'ai créer un petit soft permettant de changer les icones du menu démarrer via la base des ergistres mais cette manipulation doit nécéssiter une actua


Nos sponsors


Sondage...

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,920 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales