简体   繁体   中英

How to programatically position a Windows 7 Gadget in the top right corner of the screen?

At our school district we support about 2,000 Windows 7 PCs. We have created a Windows 7 gadget that sits in the user's top right corner and displays the computer name and IP. This aids us when a user calls so that we can remotely connect to the computer they are on.

The problem is the screen resolution varies quite a bit all over our district. Some use 1024x768 on 17" monitors and others use much larger resolutions if they have 20"+ or multiple screens.

On larger screens the gadget actually appears more towards the center. This is because a GPO adds the gadget to the user's desktop and the gadget's ini file contains the X & Y locations of the gadget.

This is stored in the PrivateSetting_GadgetDropLocationX = XXX and PrivateSetting_GadgetDropLocationY = YYY settings where XXX and YYY are the number of pixels from the top left corner of the screen.

What I woudl love to do is have the Gadget itself find the user's top right corner of the screen by simply finding the screen dimensions and moving itself. This way the gadget would always appear in the top-right no matter how small or large the user's screen was.

Does anyone have an idea on how to do this? I would love it if I could do something like PrivateSetting_GadgetDropLocationX = -1 or something to indicate 1 pixel from the top right.

Is there any way to move the gadget using JavaScript code in the gadget itself?

While this is not a direct answer to your question, its possibly an alternative. Microsoft has a utility called BGInfo http://technet.microsoft.com/en-us/sysinternals/bb897557 which will take the info your want displayed and merge it with whatever background is present on the PC. I've used it before on numerous workstations and there's no reason you couldn't deploy it with GP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM