Announcement

Collapse
No announcement yet.

Remote Script Requests and Help

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by stipus View Post
    Darren,

    Have a look at this one... I think it's what you asked for:




    Save this script as remote_lights.cs
    Call it with the device codes as parameters as shown on the above picture.

    [EDIT] code attached as it wouldn't print on the message board
    Thanks Stipus worked great...even remote.

    Is there a way to get application bar in taskbar when the form is run up. (this goes for all of the scripts)

    Cheers,

    Darren

    Comment


      #17
      Vista SideBar Gadget

      Has anyone thought about extending this connector functionality to a Vista SideBar gadget?

      Comment


        #18
        Is there a way to get application bar in taskbar when the form is run up. (this goes for all of the scripts)
        Here each Window opened by the script client has it's own "box" in the taskbar (tested with Windows 2003 server and Windows XP SP2), and I just checked I can also see each active windowed script in the windows task list.

        Has anyone thought about extending this connector functionality to a Vista SideBar gadget?
        It should be possible, but the nature of Vista gadgets (basically it's HTML + javascript only) won't help. However it's possible to host an active-x object in a HTML page, and this also works with Vista Gadgets.

        This makes me think I could write an active-x HsScript host...
        --
        stipus

        Comment


          #19
          Doooh......

          I meant to say

          <TABLE cellSpacing=0 cellPadding=3 width="100%" border=0><TBODY><TR><TD class=alt2 style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset">Is there a way to get RID of application bar in taskbar when the form is run up. (this goes for all of the scripts) </TD></TR></TBODY></TABLE>

          Sorry!!!! One little word makes all the difference!

          Comment


            #20
            Originally posted by stipus View Post

            This makes me think I could write an active-x HsScript host...
            Customised Sidebar gadget....could be very cool.....with the event log as a ticker tape streaming object under the control

            Then you could have a callerID popup from the SIP/Skype connector

            Off I go .....sorry!

            Cheers,

            Darren

            Comment


              #21
              Originally posted by darren-mc View Post
              Doooh......

              I meant to say

              <TABLE cellSpacing=0 cellPadding=3 width="100%" border=0><TBODY><TR><TD class=alt2 style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset">Is there a way to get RID of application bar in taskbar when the form is run up. (this goes for all of the scripts) </TD></TR></TBODY></TABLE>

              Sorry!!!! One little word makes all the difference!
              Yes you can easily do this:

              For c# Scripts, add the following line to the Form Constructor
              this.ShowInTaskbar = false;

              For vb Scripts, add the following line:
              Me.ShowInTaskbar = False


              --
              stipus

              Comment


                #22
                Remote_IE Works BUT....

                I use your script in conjunction with my Driveway alarm and Web-camera...

                When the driveway alarm goes off I push the Camera feed to several PC's...

                It works GREAT...almost too well...

                It opens a NEW session each time the alarm goes off.... oops...left my computer on when I was away... I had 30 screens going all off the same camera....

                Is there anyway to Open only 1 new session OR bring an existing session to the front? The URL is always the same.

                Comment


                  #23
                  There is a way to do this, as we can get windows titles from the script.

                  We can loop over all open windows on the desktop, check if one already exists with the title you have, and if so we don't need to run IEXPLORE again.

                  Can you send me the exact title of the window (including all spaces and dashes.)
                  --
                  stipus

                  Comment


                    #24
                    You can try the following script:

                    Code:
                    #USING System.Diagnostics
                    #USING System.Runtime.InteropServices
                     
                    [DllImport("user32.dll", SetLastError = true)]
                    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
                     
                    [DllImport("user32.dll")]
                    [return: MarshalAs(UnmanagedType.Bool)]
                    static extern bool SetForegroundWindow(IntPtr hWnd);
                     
                    void Main( object param )
                    {
                     IntPtr hWnd = FindWindow( null, "Google - Microsoft Internet Explorer" );
                     if( hWnd == IntPtr.Zero )
                     {
                      ProcessStartInfo processStartInfo = new ProcessStartInfo();
                      processStartInfo.FileName = "IEXPLORE.EXE";
                      processStartInfo.Arguments = param.ToString();
                      processStartInfo.WindowStyle = ProcessWindowStyle.Maximized;
                      Process.Start( processStartInfo ); 
                     }
                     else
                     {
                      SetForegroundWindow( hWnd );
                     }
                    }
                    Replace "Google - Microsoft Internet Explorer" with the title of the window you don't want to open several times.

                    This sample also shows you can use any function in any DLL from script connector scripts. Here 2 functions have been imported from user32.dll
                    --
                    stipus

                    Comment


                      #25
                      Error message on only one-pop-up script

                      I got the following message after cut-n-pasting your new script in....

                      Compile Error : Scripts\Remote_ie.cs : CompilerError[s] : line:1 error:CS1024 'Preprocessor directive expected' line:1 error:CS1025 'Single-line comment or end-of-line expected' line:2 error:CS1024 'Preprocessor directive expected' line:2 error:CS1025 'Single-line comment or end-of-line expected'

                      Here is what I put on the server and the remote station...

                      #USING System.Diagnostics
                      #USING System.Runtime.InteropServices
                      [DllImport("user32.dll", SetLastError = true)]
                      static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
                      [DllImport("user32.dll")]
                      [return: MarshalAs(UnmanagedType.Bool)]
                      static extern bool SetForegroundWindow(IntPtr hWnd);
                      void Main( object param )
                      {
                      IntPtr hWnd = FindWindow( null, "Front Camera" );
                      if( hWnd == IntPtr.Zero )
                      {
                      ProcessStartInfo processStartInfo = new ProcessStartInfo();
                      processStartInfo.FileName = "IEXPLORE.EXE";
                      processStartInfo.Arguments = param.ToString();
                      processStartInfo.WindowStyle = ProcessWindowStyle.Maximized;
                      Process.Start( processStartInfo );
                      }
                      else
                      {
                      SetForegroundWindow( hWnd );
                      }
                      }


                      What did I do wrong ?

                      Comment


                        #26
                        It might be a copy/paste problem but I don't see it.

                        Just download and unzip the attached script... I tested it here and I'm sure it works.
                        Attached Files
                        --
                        stipus

                        Comment


                          #27
                          That got it... thanks....

                          Comment


                            #28
                            General question

                            Did I read it wrong, and if not why do I need it?

                            I think I read that the script needs to reside on both the Central HS2 system and on EACH of the clients that is going to run the script.

                            Why is that ? I can see it being needed on the clients, but why on the central unit, or was that only for when the clients were going to run something on the server ?

                            Just curious....

                            Comment


                              #29
                              The scripts are needed only on the computer(s) running them.

                              No need to keep remote scripts on your main HS server, if you don't run the script client on the main hs server.
                              --
                              stipus

                              Comment


                                #30
                                Only one window pop is flaking out...

                                I thought it was working, but now I have multiple windows again...

                                Questions so I can TRY to learn...

                                1) Where do I get the Window name?
                                -Is it in taskMan, do I need the ENTIRE name or just something unique?

                                2) I have Seen FindWindow writen with the target First, and the Target last,
                                Which is it?


                                FindWindow( "Bellwoods1", null ); or
                                FindWindow( null, "Bellwoods1" );

                                I looked in the Source for the window I am trying to only open 1 of and saw...

                                function GetMyName()
                                {
                                return "Bellwoods1";
                                }

                                but is that the name I am looking for ?

                                The Lable in Taskman is quite long, with "Bellwoods1" the first part of it...

                                I looked up FindWindow hoping for an Easy description, but found lots af talk about wrappers, FindWindowEx, and more, so I am affraid I must ask for help again...

                                Comment

                                Working...
                                X