CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    May 2013
    Chelsea, MI

    Unhappy 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 . . .

     SendMessage("PowerHome", WM_USER, 3445, 5)
    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.

    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! :-)

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Hanover Germany

    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
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.