Thanks for your advise, on the other hand I found sendmessage() funtion can
do the job:
++++++++++++++++++++++++++++++++++++++++++++++++++++
Option Strict Off
Option Explicit On
Module InpOut32_Declarations 'Inp and Out declarations for port I/O using
inpout32.dll.
Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal
PortAddress As Short) As Short
Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal
PortAddress As Short, ByVal Value As Short)
End Module
Friend Class frmSend
Inherits System.Windows.Forms.Form
Const cHIDDEN_WINDOW_TITLE As String = "Main Control Panel - Robot
Control Centre"
Const WM_SETTEXT As Integer = &HC
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef
lParam As Integer) As Integer
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA"
(ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal
lpsz2 As String) As Integer
Private Sub frmSend_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim FHandle As Integer
Dim currentstatus As String
Dim THandle As Integer
FHandle = FindWindow(vbNullString, cHIDDEN_WINDOW_TITLE)
THandle = FindWindowEx(FHandle, 0, vbNullString, vbNullString)
currentstatus = Inp(&H379S)
MsgBox(currentstatus)
While FHandle <> 0
SendMessage(THandle, WM_SETTEXT, 0, currentstatus)
System.Threading.Thread.Sleep(500)
FHandle = FindWindow(vbNullString, cHIDDEN_WINDOW_TITLE)
'MsgBox(FHandle)
End While
Me.Close()
End Sub
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
the adove code can send a integer from on window to another, but the problem
is the integer send from sender can not display properly in the textbox of
receiver, for example, I send 123, it display {, if sent other integer, it
may display some unknow contents, do you have any idea?