| 
    
     | 
       
        | Author |  |  
        | GadgetGuy Super User
 
  
  
 Joined: June 01 2008
 Location: United States
 Online Status: Offline
 Posts: 942
 | 
          OK, all you smart coders out there.  I have been able to
           | Posted: May 15 2013 at 07:37 | IP Logged |   |  
           | 
 |  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 |     |  
        |  |  
        | GadgetGuy Super User
 
  
  
 Joined: June 01 2008
 Location: United States
 Online Status: Offline
 Posts: 942
 | 
          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.
           | Posted: June 29 2013 at 13:49 | IP Logged |   |  
           | 
 |  
 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 |     |  
        |  |  |  |