Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: vista gadget Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: April 23 2009 at 16:39 | IP Logged Quote krommetje

Anyone have an idea or a URL on info on how to make a Vista Gadget for PH?

Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: April 23 2009 at 16:54 | IP Logged Quote BeachBum

That would be interesting. You mean as in Control Center?

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: April 24 2009 at 00:29 | IP Logged Quote krommetje

Well, i am thinking about a small gadget which has a drop down menu and runs macros.... it is just html with some extra settings in css if i am correct....

Peter

Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: April 24 2009 at 08:54 | IP Logged Quote BeachBum

Yes it is mostly HTML. If someone has some spare time this information should be helpful building the gadget. I know there are those out there that are proficient in HTML coding.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: April 24 2009 at 11:18 | IP Logged Quote krommetje

reading now.... mmm testgadget doesn't turn up in the list!

I think since all is done locally, the socketserver needs to be used...


Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: April 27 2009 at 15:54 | IP Logged Quote krommetje

TONYNO where are you....

I think some WSH inside HTML should do the trick

like this (a working snippet that starts notepad.exe form a webpage)?
Code:


<HTML>
<HEAD>
<TITLE>test</TITLE>
<SCRIPT LANGUAGE="VBScript">
<!--

Sub Window_Onload
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("c:\windows\notepad.exe")
Msgbox "The application has started."
End Sub

-->
</SCRIPT>
</HEAD>


maybe we can brainstorm any further on this?


Edited by krommetje - April 27 2009 at 16:48
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: April 30 2009 at 06:03 | IP Logged Quote krommetje

No answers yet...

I have gotten thus far:

I have created a gadget. It is basic html with VBScript and calls a batch-file which in turn calls phsscmd.exe with parameters. Disadvantage is that for every action, you have to create a seperate batchfile.

Code:

<html>
<head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <meta name="GENERATOR" content="Amnesty Generator 0.5b">
     <style type="text/css">
           @import "generator.css";
     </style>
     <script type='text/javascript' src='generator.js' charset="utf-8"></script>
</head>

<body onfocus='generator_setup();'>
     <div id="gadget" onmouseover='generator_track();'>
     <HTML>
<HEAD>
<TITLE>test</TITLE>
<SCRIPT LANGUAGE="VBScript">
<!--

Sub Window_Onload
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\1.bat")
End Sub

-->
</SCRIPT>
</HEAD>
</div>
</body>
</html>


the batchfile speaks for itself....

now for the enhancement of the HTML-file....

Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: April 30 2009 at 07:58 | IP Logged Quote BeachBum

I think Tony is on a hiatus. So what parameters are in the batch file? I’m sure they speak for themselves but I’m dense Peter.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: May 01 2009 at 02:42 | IP Logged Quote krommetje

BeachBum wrote:
I think Tony is on a hiatus. So what parameters are in the batch file? I’m sure they speak for themselves but I’m dense Peter.


it is just a basic batch-file:

Code:

cd\
cd peter
cd phsscmd
phsscmd.exe ph_macro('huiskamerlampen aan')


I choose this method instead of the dirict one so I was sure that at least the PHSSCMD section works. I've have the tendancy to mix-up " with ' so.....

Update:

I've got the whole thing working in HTML/VBS

Code:

<HTML>
<HEAD><TITLE>krommetje test gadget</Title></HEAD>
<BODY BACKGROUND="m45.gif" TEXT=#FFFFFF>
<Form name=listing>
<select name=choice>
     <option selected value=1><B>Lights on</B>
     <option selected value=2><B>Lights Off</B>
     <option selected value=3><B>Frontdoor down</B>
     <option selected value=4><B>frontdoor up</B>
     <option selected value=5><B>backdoor down</B>
     <option selected value=6><B>backdoor up</B>
     <option selected value=7><B>maikelight</B>
</select>
<P><input type=button value="run" onClick="options_onclick(listing.choice.value)">

<Script Language = VBScript>
sub options_onclick(f)
     select case f
     case 1
               
                Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\1.bat")
                Msgbox "The application has started."
               
     case 2
               section2
     case 3
                section 3
               
     case 4
               section4

     case 5

               section 5

        case 6
               document.write "sectie6"
        case 7
               document.write "sectie7"
     end select
end sub
</Script>
</CENTER>
</BODY>
</HTML>


together with phsscmd.exe and the batchfile it should be capable of running as a gadget! As you see, the html/vbs is actually just a VBS-menu which calls a subroutine in the case section which in turn calls the batch-file...

just edit the html/vbs to your needs (see section 1 in the VBS as a guidance), create the batch-files and you're in business.

Peter

Edited by krommetje - May 01 2009 at 02:49
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: May 11 2009 at 10:03 | IP Logged Quote TonyNo

Congrats on the progress! I was out-of-commission for a bit, but I'm back now.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: May 11 2009 at 10:52 | IP Logged Quote krommetje

Hey TonyNo

how do you like my gadget so far? any ideas on how to make it better?

when running everything in html in a browser, all works, but as soon as the gadget is installed....

here is what I have so far:

Code:

<html>
<head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <meta name="GENERATOR" content="Amnesty Generator 0.5b">
     <style type="text/css">
             @import "generator.css";
     </style>
     <script type='text/javascript' src='generator.js' charset="utf-8"></script>
</head>

<body onfocus='generator_setup();'>
     <div id="gadget" onmouseover='generator_track();'>
     <HTML>
<HEAD>
<TITLE>test</TITLE>
<BODY BACKGROUND="m45.gif" TEXT=#FFFFFF>
<P>
<P>
<CENTER>
<Form name=listing>
<select name=choice>
     <option selected value=1><B>Lights on</B>
     <option selected value=2><B>Lights Off</B>
     <option selected value=3><B>Frontdoor down</B>
     <option selected value=4><B>frontdoor up</B>
     <option selected value=5><B>backdoor down</B>
     <option selected value=6><B>backdoor up</B>
     <option selected value=7><B>maikelight</B>
        <option selected value=8><B>maikelight</B>
        <option selected value=9><B>maikelight</B>

</select>
<P><input type=button value="run" onClick="options_onclick(listing.choice.value)">

<Script Language = VBScript>
sub options_onclick(f)
     select case f
     case 1
               
                Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\1.bat")
                               
     case 2
                             Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\2.bat")
                               

     case 3
                             Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\3.bat")
                               
"
     case 4
                Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\4.bat")
                               

     case 5
                             Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\5.bat")
                               

        case 6
                             Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\6.bat")
                               

        case 7
                         Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\7.bat")
                               

        case 8
                             Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\8.bat")
                               

        case 9
                             Set objShell = CreateObject("WScript.Shell")
                Set objWshScriptExec = objShell.Exec("C:\Users\Peter\AppData\Local\Microsoft\Window s Sidebar\Gadgets\Peter's X10 gadget.gadget\9.bat")
                               

     end select
end sub
</Script>
</CENTER>
</BODY>
</HTML>





you can download the whole package here:

http://www.krommetje.nl/download/petergadget.rar

Edited by krommetje - May 11 2009 at 11:03
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: May 12 2009 at 09:24 | IP Logged Quote TonyNo

So, it works fine in IE?

FYI, no Vista here.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: May 12 2009 at 13:30 | IP Logged Quote krommetje

nope... ie says fault!
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: May 20 2009 at 05:49 | IP Logged Quote krommetje

An Update:

I've got the error (those fr**k**g """""again)

the HTML/vbscript works, but now the batchfiles aren't executed... reason is the administrator rights in Vista policy....

but he Gadget Runs!!!!

Get the skeleton: phgadget.rar (I will mail this to Dave for downloading)

You need: SteelRunAs.exe to be downloaded from www.steelsonic.com/steelrunas.htm

Create a batchfile for every action you want in the gadget, the batchfile calls phsscmd.exe with parameters for that action. use CMD as extension...

Run SteelRunAs.exe and select the batch file(s) needed for the gadget. SteelRunAs creates a CRC and compiles the CMD-file(s) to an EXE file(s),

Copy all files to a seperate directory, name the directory e.g. Powerhome.gadget
If the generator.html runs in IE, it will run as a gadget...

Copy the whole powerhome.gadget directory to the local gadget directory on your computer and your done!!!

Add the new gadget to the sidebar....

You need a working phsscmd.exe (put the location in the PATH)

Peter





Edited by krommetje - May 20 2009 at 10:09
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: August 20 2009 at 11:39 | IP Logged Quote krommetje

I went to work on a second gadget and wanted to do the following:

retreive an internal PSP page with 2 GV's, save it it:

Code:

ph_saveitcurl("http://192.168.1.251:9600/meteo.psp","C:\Prog ram Files\powerhome\web\gadget\gedget.html",1,30)


and show it in a vista gadget with an inlineframe.

my question:

it worked Once and now I am getting an error 4....!
I checked writing permissions....all is OK... why?
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 

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