Sidebar gadgets outside the sidebar?

Hi guys, I'm interested on building some gadgets and I'd like to know a couple of info about this specific type.

1) Can they exist outside the sidebar In this case, can they know their position in the stage

2) Can they communicate to each other

I had a look to the API and I couldn't find so much information about these topics.

Any info will be very appreciated.

Thanks, chr



Answer this question

Sidebar gadgets outside the sidebar?

  • Victor Egbe

    Hi Bruce, so you mean I can write an ActiveX that can notice a widget about the changing of a file Or just that checks the file often

    Thanks, chr


  • SillyMS

    Yes, you can use the window.screenLeft and window.screenTop properties to determine where on the desktop the gadget is.


  • Adarsh123

    If you must do something that frequently, you should listen for the power state changed event, and reduce the frequence dramatically when running on battery.
  • Wanty

    We don't provide a simple gadget API to let two gadgets communicate with each other. There is no technical reason, however, stopping you from using any existing OS mechanism to communicate between two gadgets. For example, one gadget could write a value to a file, and another gadget could read it. (I'm not claiming that's the best option, although it may be the easiest to implement.)
  • Corres

    Don't use files whatever you do - as you say, it's far too slow.

    Use the registry. Write to your own key under HKEY_CURRENT_USER, it uses next to no CPU time.

    var oShell = new ActiveXObject("WScript.Shell");
    ...
    oShell.RegWrite("HKCU\\Software\\MyGadget", "some text", "REG_SZ");

  • Kart_lin

    Thanks Brian, good idea!
  • Laura Bagnall

    You'll need to create an account on AeroXP before you can download it from the link above. Sorry, I should have said.

  • ADub

    Well, this could work only partially, the problem is to make a gadget reacting based on an event in another gadget. And of course reading a file every 100 m/s to check changes is not an option, and I don't think you integrated listeners to trigger eventual modification to a file without a continuous check. Am I wrong

    Thanks, chr


  • SQLDataMonkey

    I think he means, you can fire a function in one Gadget from another. Have a look a Bruce's sidebarAlert gadget as this registers a JavaScript function for triggering from ActiveX.

  • kyu5354

    1) I found in the API the left and top read/write property of the Background, is it the way to get the position in the screen of the widget itself (the left property is mixed with the width btw so I presume that API is far to be ready).

    Thanks a lot, chr


  • barkingdog

    Now I can't see it but that is definitely what I was looking for.

    Thanks, chr

  • ForEverLearning

    Good to know, Jonathan. But I still think that write somewhere to call an event in another gadget is a crazy procedure. Just for curiousity, is it a normal practice to read a registry so frequently, for instance every 100 milliseconds Probably it will take no cpu time, but if we have more widgets that are waiting, doesn't it become a problem, or very bad practice

    Thanks, chr


  • drdexter33

    gabon wrote:

    Well, this could work only partially, the problem is to make a gadget reacting based on an event in another gadget. And of course reading a file every 100 m/s to check changes is not an option, and I don't think you integrated listeners to trigger eventual modification to a file without a continuous check. Am I wrong

    Thanks, chr

    Right, that's why I suggested it might not be the best option - I was just pointing out that it is possible.

    If you need high performance, then write an ActiveX object that wraps a Win32 'Event' object. One method on your ActiveX can signal the event, another method can register a callback and start a listener thread that calls the callback when it detects that the event was signalled. That's probably about as high-performance as you're going to get.


  • yosonu

    Thanks Bruce, and so I presume they can stay outside the sidebar, but can they then communicate eachother

    best, chr


  • Sidebar gadgets outside the sidebar?