Commande Executer dans Demarrer

cs_julleroyfr Messages postés 22 Date d'inscription jeudi 3 avril 2003 Statut Membre Dernière intervention 11 juillet 2005 - 27 juin 2003 à 11:48
cs_julleroyfr Messages postés 22 Date d'inscription jeudi 3 avril 2003 Statut Membre Dernière intervention 11 juillet 2005 - 29 juin 2003 à 17:44
Salut
j'aimerais reproduire la commande executer qui se trouve dans démarrer.
j'ai cherche sur le site mais de très concluant
Siouplait aidez moi

4 réponses

ShareVB Messages postés 2676 Date d'inscription vendredi 28 juin 2002 Statut Membre Dernière intervention 13 janvier 2016 26
27 juin 2003 à 12:15
salut

pour faire afficher la boite de dialogue :
Declare Function SHRunDialog Lib "shell32" Alias "#61" (ByVal hOwner As Long, ByVal Unknown1 As Long, ByVal Unknown2 As Long, ByVal szTitle As String, ByVal szPrompt As String, ByVal uFlags As Long) As Long

'If uFlags is the following constant, the string from the last-run program will not appear in the dialogs combo box
Const shrdNoMRUString = &H2 '2nd bit is set
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Function SHRunDialog Lib "shell32" Alias "#61" (ByVal hOwner As Long, ByVal Unknown1 As Long, ByVal Unknown2 As Long, ByVal szTitle As String, ByVal szPrompt As String, ByVal uFlags As Long) As Long
Private Sub Form_Load()
'KPD-Team 2001
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim sTitle As String, sPrompt As String
sTitle = "Start a program ..."
sPrompt = "Type the name of a program ..."
If IsWinNT Then
SHRunDialog Me.hWnd, 0, 0, StrConv(sTitle, vbUnicode), StrConv(sPrompt, vbUnicode), 0
Else
SHRunDialog Me.hWnd, 0, 0, sTitle, sPrompt, 0
End If
End Sub
Function IsWinNT() As Boolean
Dim OSInfo As OSVERSIONINFO
OSInfo.dwOSVersionInfoSize = Len(OSInfo)
'Get the Windows version
Ret& = GetVersionEx(OSInfo) IsWinNT (OSInfo.dwPlatformId 2)
End Function

cette exemple vient de allapi.net

pour reproduire tu utilises l'api shellexecute
il y a des exemples sur ce site

voila

ShareVB
0
cs_julleroyfr Messages postés 22 Date d'inscription jeudi 3 avril 2003 Statut Membre Dernière intervention 11 juillet 2005
28 juin 2003 à 15:11
Merci d'avoir répondu, je me rapproche de plus en plus de la solution que je voudrais obtenir.
Comment je fais si je veux juste un textbox sur ma form
qui envoie l'instruction à cette boite de dialogue sans l'ouvrir?
Merci d'avance
0
ShareVB Messages postés 2676 Date d'inscription vendredi 28 juin 2002 Statut Membre Dernière intervention 13 janvier 2016 26
28 juin 2003 à 17:53
salut

pour faire ca faut utiliser ShellExecute :
dans une form avec un commandbutton Command1 et un textbox CmdText

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, vbNullString, CmdText.text, vbNullString, "C:", SW_SHOWNORMAL
End Sub

voila

ShareVB
0
cs_julleroyfr Messages postés 22 Date d'inscription jeudi 3 avril 2003 Statut Membre Dernière intervention 11 juillet 2005
29 juin 2003 à 17:44
Merci ca marche trop bien.
0
Rejoignez-nous