Ejecutar Programa .exe desde C
Publicado por Reinaldo Flores (2 intervenciones) el 16/01/2002 12:18:14
Por ejemplo, yo en VB con el siguiente código ejecuto el "notepad.exe",
ahora, ¿como lo hago para que funcione desde VC?.
Private Sub Command1_Click()
Dim JobToDo As String
JobToDo = "c:\windows\notepad.exe"
Shell32Bit JobToDo
End Sub
Sub Shell32Bit(ByVal JobToDo As String)
Dim hProcess As Long
Dim RetVal As Long
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(JobToDo, 6))
Do
GetExitCodeProcess hProcess, RetVal
DoEvents: Sleep 100
Loop While RetVal = STILL_ACTIVE
End Sub
ahora, ¿como lo hago para que funcione desde VC?.
Private Sub Command1_Click()
Dim JobToDo As String
JobToDo = "c:\windows\notepad.exe"
Shell32Bit JobToDo
End Sub
Sub Shell32Bit(ByVal JobToDo As String)
Dim hProcess As Long
Dim RetVal As Long
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(JobToDo, 6))
Do
GetExitCodeProcess hProcess, RetVal
DoEvents: Sleep 100
Loop While RetVal = STILL_ACTIVE
End Sub
Valora esta pregunta


0