cs_julleroyfr
Messages postés22Date d'inscriptionjeudi 3 avril 2003StatutMembreDernière intervention11 juillet 2005
-
27 juin 2003 à 11:48
cs_julleroyfr
Messages postés22Date d'inscriptionjeudi 3 avril 2003StatutMembreDernière intervention11 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
ShareVB
Messages postés2676Date d'inscriptionvendredi 28 juin 2002StatutMembreDernière intervention13 janvier 201626 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
cs_julleroyfr
Messages postés22Date d'inscriptionjeudi 3 avril 2003StatutMembreDernière intervention11 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
ShareVB
Messages postés2676Date d'inscriptionvendredi 28 juin 2002StatutMembreDernière intervention13 janvier 201626 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