El Guru Programador
Usuario DESCONOCIDO | Registrate Gratis | Usuarios Registrados
Foro de Visual Basic/VB.NET
Foros del Guru > Visual Basic/VB.NET
Usuario MS-DOS en dentro de un formulario
Desconocido
Enviado - 5/7/2003
 
Quisiera introducir dentro de un formulario de vb6.0 el simbolo de sistema de windows. Es decir, ms-dos incrustado en una ventana.Gracias.
 
fmarredo
355 Mensaje(s)
Enviado - 7/7/2003
 
Option Explicit

Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function CloseWindow Lib "user32" (ByVal hwnd As Long) As Long

Private Sub Command1_Click()
Dim dosHwnd As Long

Shell ("command.com")

Do While dosHwnd = 0
DoEvents
dosHwnd = FindWindow(vbNullString, "C:\WINNT\System32\command.com")
Loop

SetParent dosHwnd, Frame1.hwnd
MoveWindow dosHwnd, 0, 0, Frame1.Width, Frame1.Height, True
End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim dosHwnd As Long

dosHwnd = FindWindowEx(Frame1.hwnd, 0, vbNullString, "C:\WINNT\System32\command.com")

CloseWindow dosHwnd
End Sub

 
 

 

Contactos myStudio Network