Link to home
Start Free TrialLog in
Avatar of HellSlayer
HellSlayer

asked on

PostMessage... GetMessage???

I want the new instance of an app to send a message to the old one.

For example I start MyProg by clicking "first.txt". After that I click on "second.txt" and I want the new MyProg to do something like :

PostMessage(oldMyProgHandle, WM_COMMAND, 0&, "second.txt")


But how do I Get the message ??
Avatar of mcrider
mcrider

You need to create a message handler (windows hook) See the following microsoft KB articles:

HOWTO: Build a Windows Message Handler with AddressOf in VB
http://support.microsoft.com/support/kb/articles/q170/5/70.ASP?LNG=ENG&SA=MSDN&FR=0 

HOWTO: Pass String Data Between Applications Using SendMessage
http://support.microsoft.com/support/kb/articles/Q176/0/58.ASP?LNG=ENG&SA=MSDN&FR=0 

HOWTO: Hook Into a Window's Messages Using AddressOf
http://support.microsoft.com/support/kb/articles/Q168/7/95.asp?LNG=ENG&SA=MSDN&FR=0 


Cheers!®©

ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HellSlayer

ASKER

Really cool sample without any API !!!