Code:
Private Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As String) As Long
Private Const WM_CHAR = &H102

Private Sub Command1_Click
Call SendMessageByString(thehwndoftheprogram, WM_CHAR, 0&, Chr$(13))
End Sub

havent tried that, but it should work.