VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Inter-Process Messaging

Phobos  (6 Submissions)   VB function enhancement   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

This provides a SIMPLE solution to sending data between any 2 vb applications. No ActiveX, DDE, COM, DCOM or OLE requirements. The transfer process is easy to follow and you should have little difficulty passing to more controls if required.

Inputs
In your own program substitue "Receiving AppName" with the name of your program (on both sending and receiving ends). For every control that is to have data passed to it just create an entry as per the textbox examples; SaveSetting sAppName, "InterProcess Handles", "Text1", Str$(Text1.hWnd)

Assumes
The sample forms provided show text being passed to 3 textboxes, but you could easily modify to pass to combo boxes etc. The solution involves teporary storage in the windows registry of the necessary windows handles. If you want the recipient program to act upon the received text you could simply add a change procedure such as; Private Sub Text1_Change() MsgBox "Change detected" End Sub I hope you find this solution usefull and if you like it, please vote for me.

Returns
When text data is sent to the receiving program it is placed straight in to the control and are ready for use.

API Declarations
The following declarations are present at the start of the message sending program. No other API's are required.
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SETTEXT = &HC

Rate Inter-Process Messaging (4(4 Vote))
Inter-Process Messaging.bas

Inter-Process Messaging Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters