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?

  • D119

    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");

  • Peterbrown77

    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


  • Paps

    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.)
  • GrandpaB

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


  • NET PR

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

    best, chr


  • sic0198

    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.


  • yoga80

    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.
  • TwilightBrigade

    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.

  • Luke R

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

    Thanks, chr

  • mhodder

    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


  • quame

    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


  • Barry Kwok

    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


  • Juice Johnson

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

  • js123

    Thanks Brian, good idea!
  • Sidebar gadgets outside the sidebar?