Or maybe better
VB Code:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) 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 GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Dim lngHandle As Long
Dim rec As RECT
Picture1.AutoRedraw = True
Form1.ScaleMode = vbPixels
Shell "c:\WINDOWS\system32\calc.exe", vbNormalFocus
lngHandle = FindWindow(vbNullString, "Calculator")
GetWindowRect lngHandle, rec
SetParent lngHandle, Picture1.hwnd
Picture1.Width = rec.Right - rec.Left
Picture1.Height = rec.Bottom - rec.Top
' The first 5 parameters are required but weonly care about the 1st three
MoveWindow lngHandle, 0, 0, Picture1.Width, Picture1.Height, 1
End Sub