May 15th, 2013, 09:59 AM
Code Needed to SendMessage for WM_USER interprocess communication to another program
I have been able to code a number of VBScript executable routines to do special things to control my home security system program (PowerHome), but have gotten stumped on what seems like it should be the easiest thing I've ever tried. :-(
When my video cameras see motion I want to send a WM_USER message to my security program that is setup to recognize such notices. The camera program can call any executable when motion is detected, so I want a simple VB Script that just sends a Windows Message, using I believe . . .
where "PowerHome" is the handle for the running target window process, and the later two are the parameters to be passed to PowerHome to fire the trigger using Trigger Type WM_USER.
SendMessage("PowerHome", WM_USER, 3445, 5)
No matter what I have tried, I either compile with a Syntax error, or an Expected end of Statement error.
Since I think this should be just a few lines of code and don't want to prejudice any suggestions, could anyone post a complete VB Script code stream?
BTW. I'm running this in a 64-bit Win7 environment, which I think makes a difference. I also really need a complete program, as the devil is in the details and my many attempts have failed, so I am missing something basic.
MUCH THANKS! :-)
May 15th, 2013, 11:54 AM
Re: Code Needed to SendMessage for WM_USER interprocess communication to another prog
Is the handle of "the running target window process" you are using in SendMessage call a correct one?
Did you try to call IsWindow() API to ensure it is correct?
As for Windows 7 additional problems - see User Interface Privilege Isolation and ChangeWindowMessageFilterEx function
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.