Visual Basic - Form MDI a red URGENTE

Life is soft - evento anual de software empresarial
 
Vista:

Form MDI a red URGENTE

Publicado por shadow (1 intervención) el 29/05/2004 22:53:05
hice un programa para conectarme a una pc mediante un server/cliente mediante IP y quiero ejecutar programas que esten en el server desde el cliente y para eso consegui una ventana MDI con este condigo:

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
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Const GW_HWNDNEXT = 2
Dim mWnd As Long
Function InstanceToWnd(ByVal target_pid As Long) As Long
Dim test_hwnd As Long, test_pid As Long, test_thread_id As Long
test_hwnd = FindWindow(ByVal 0&, ByVal 0&)
Do While test_hwnd <> 0
If GetParent(test_hwnd) = 0 Then
test_thread_id = GetWindowThreadProcessId(test_hwnd, test_pid)
If test_pid = target_pid Then
InstanceToWnd = test_hwnd
Exit Do
End If
End If
test_hwnd = GetWindow(test_hwnd, GW_HWNDNEXT)
Loop
End Function

Private Sub ANP_Click()
Dim Pid As Long
LockWindowUpdate GetDesktopWindow
Pid = Shell("c:\windows\notepad.exe", vbNormalFocus)
If Pid = 0 Then MsgBox "Error Iniciando la Aplicación"
mWnd = InstanceToWnd(Pid)
SetParent mWnd, Me.hwnd
Putfocus mWnd
LockWindowUpdate False
End Sub


Private Sub MDIForm_Unload(Cancel As Integer)
DestroyWindow mWnd
TerminateProcess GetCurrentProcess, 0
End Sub

Private Sub Salir_Click()
End
End Sub

y en donde dice shell que hay que poner el directorio me gustaria poner un commond dialog o un cd o lunkarlo con un file pero para poder ver lko archivos que hay en la server y asi ejecutar el programa.

informacion me la pueden enviare a este mail [email protected]
urgente lo antes posible
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder