Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Visual Basic code to SendMessage Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: May 15 2013 at 07:37 | IP Logged Quote GadgetGuy

OK, all you smart coders out there. I have been able to
code a number of Visual Basic executable routines to do
special things in PowerHome, but have gotten stumped on
what seems like it should be the easiest thing I've ever
tried.

I want to fire a PH Trigger when my security cameras see
motion. The camera program can call any executable when
motion is detected, so I want a simple VB prgm that just
sends a Windows Message to PH, using I believe

Code:
SendMessage("PowerHome", WM_USER, 3445, 5)


where the later two are the parameters to be passed to PH
to fire the trigger using Trigger Type WM_USER.

No matter what I have tried, I either compile with a
Syntax error, or an End of Statement expected.

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 program code stream?

BTW. I'm running this in a 64-bit Win7 environment, which
I think makes a difference.   

THANKS!


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: June 29 2013 at 13:49 | IP Logged Quote GadgetGuy

For the sake of completeness (although this does appear in a few scattered posts) here is information about a routine that Dave has placed in the Download Section of the PowerHome Home page.

It is a program called "phwmcmd.exe"

It is a PowerHome Windows Message Command Line Controller that will allow you to control PowerHome from the command line of the local PowerHome machine using Windows Messaging. Newly updated under VB and includes full sourcecode.

From my security camera software I call

Code:
C:\powerhome\phwmcmd.exe ph_macroparm("CAMTRIG",2,0,0,0,0)


using the ph_macroparm()function to call my Camera Trigger macro with the camera# (eg, 2) passed as a parameter.

Works easily and like a charm!

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum