VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Inter-Process Communications

by Roger D Taylor (5 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (16 Votes)

OK, we've all been in the situation where you want a multi tread application but since VB is single threaded it is difficult to do, so you create a second vb app and line the two together using winsock .... this is slow and you my be woring in a machine that does not have IP installed .... what choices do you have ..... well you can use pipes, winsock as i've already mentioned and you can also use Read/WriteProcess memory, these are time consuming and difficult to understand and write ..... but hey, what about SendMessage.... yep that good old API call. it allows you to send a data structure to an other process ..... which is fast and the message will always get there .... this code gives you a quick example of how to do this..... hope you fins this code useful ....
You may find that quitting the Client Application after you have sent the message wil cause your VB IDE to crash with a Memory exception .... if you click the control box on this form it might not crash the IDE ... this does not happen as an EXE

Inputs
You just need to enter your own text into the string variable that will be sent to the other process.
Assumes
Assumes you are comfortable with the API (CopyMemory, SendMessage, FindWindow)
Code Returns
Sends a COPYDATASTRUCT to the target process
Side Effects
You may find that quitting the Client Application after you have sent the message wil cause your VB IDE to crash with a Memory exception .... if you click the control box on this form it might not crash the IDE ... this does not happen as an EXE

Rate Inter-Process Communications

Download Inter-Process Communications

Download Inter-Process Communications (4 KB)

Inter-Process Communications Comments

No comments have been posted about Inter-Process Communications. Why not be the first to post a comment about Inter-Process Communications.

Post your comment

Subject:
Message:
0/1000 characters