|
by Naveen
26. January 2012 21:18
Download Gadget For Vworker Recent Projects (22.07 kb)
In this post I will discuss how to write a Windows 7 gadget. It has been long since I wrote a gadget. This week I was looking at putting some scroll view of
freelance projects from vWorker web site. They have a piece of HTML code that you can put on your web site to show latest open projects in
a scrolling view. When I am working on some project or executing some other tasks on my desktop, then I do not any web site open. I want to have a view of
latest open projects on side of my big desktop view. So, developing a gadget made more sense to me. So in this past I will share that gadget with all of you
who use VWorker for doing freelance work. And I will show steps to write this windows gadget as well.
Develop Windows Gadget
If you are considering Windows gadget development, then I will strongly encourage to read Microsoft documentation
on gadget framework. It will give some good basic background on gadget development. Here are steps that you will need to follow to write a simple
Windows gadget like I wrote for displaying latest open freelance projects on VWorker site.
- Create a folder with name same as what you would your gadget to be named. For example I create a folder named VWorkeLatestProjects.gadgets
- Create a 64x64 image (recommended size by Microsoft) that you would like to use a logo for your gadget. This is the logo that will show up in Windows control
panel UI when you look at available gadgets on your machine.
Create a XML file named Gadget.xml in this folder. This file will contain manifest of your gadgets. In simple terms, this file contains
all details about your gadget. This file does not contain implementation of gadget itself. Following is how my file looks like.
<?xml version="1.0" encoding="utf-16"?>
<gadget>
<name>VWorker Recent Projects</name>
<namespace>microsoft.windows</namespace>
<version>1.0.0.0</version>
<author name="ByteBlocks.com">
<info url="http://www.byteblocks.com" text="Byteblocks.com"/>
<logo src="logo.png"/>
</author>
<copyright>
© 2012</copyright>
<description>See latest open projects at vWorker.</description>
<icons>
<icon width="64" height="64" src="icon.png"/>
</icons>
<hosts>
<host name="sidebar">
<autoscaleDPI><!--_locComment_text="{Locked}"-->true</autoscaleDPI>
<base type="HTML" apiVersion="1.0.0" src="VWorkerLatestProjects.html"/>
<permissions><!--_locComment_text="{Locked}"-->Full</permissions>
<platform minPlatformVersion="1.0"/>
<defaultImage src="drag.png"/>
</host>
</hosts>
</gadget>
As you can see from this file content, it lays out blue print of the gadget.
-
Now comes the implementation of the gadget. There is an entry with tag name BASE that defines
the entry point for implementation. You will notice that I have set it to VWorkerLatestProject.html.
What this means is that when gadget loads it will load up this HTML file. So, add an HTML file in your folder
that is going to be entry point. Following is snapshot of contents of my HTML file.
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="css/vworkerlatestprojects.css" rel="stylesheet" type="text/css" />
<title>VWorker Latest Projects</title>
</head>
<body id="VWorkerProjectFeedGadget">
<g:background id="VWorkerFeedBG">
<div id="feedbody">
<iframe id="VWorkerFeedIFrame" frameborder="1" scrolling="no" width="150" height = "300"
src = "http://www.vWorker.com/RentACoder/misc/LinkToUs/ScrollingBidRequests.asp?
txtWidth=150&txtHeight=300&blnHideChannelSubscribe=true&
blnLaunchLinkInNewWindow=true&blnFullTitle=true&txtBgColor=white">
Your browser does not support inline frames...However, you can click
<a href="http://www.vWorker.com/RentACoder/misc/LinkToUs/ScrollingBidRequests.asp?
blnHideChannelSubscribe=true&blnLaunchLinkInNewWindow=true&blnFullTitle=true">
here</a> to see the related document.
</iframe>
</div>
</g:background>
</body>
</html>
As you can see, implementation is just like developing a regular HTML page. For my gadget it was as simple as putting
IFrame content for VWorker site into my HTML page. So you can see how I included that IFRAME tag inside
g:background tag of this gadget.
-
Yes, that was the whole implementation of this gadget. It is ready to be deployed and used.
Deploying Windows Gadget
Deployment of windows gadget is very simple. You just need to copy your gadget folder at either of following two locations
depending on scope and visibility of this gadget.
%USERPROFILE%\AppData\Local\Microsoft\Windows Sidebar\Gadgets (for user gadgets)
%SYSTEM_ROOT%\Program Files\Windows Sidebar\Gadgets (for global gadgets)
For example in my case, I want every user of may desktop to be able to see this gadget. So I copied it at following
location.
C:\Program Files\Windows Sidebar\Gadgets\VWorkerLatestProjects.gadget
Adding Windows Gadget To Desktop
Once you have deployed the gadget, you can follow these steps to put the gadget on your desktop
On your desktop go to Control Panel > Appearance and Personalization. Or right click on your desktop screen.
There you will see option for Gadgets. Click on it and it will bring up dialog box with Gadgets installed on your
machine. You will find your own gadget there was well. 
- Double click on the gadget icon you would like to install. It will appear docked to right side of your desktop screen.
Windows Gadget For VWorker Latest Projects
I have attached this gadget with this post. Download the zip file, unzip it in one of the two locations that I earlier specified and you will be
good to go.

by Naveen
18. June 2011 05:27
I love it when I can find all the cool tools and utlities built into my operating system itself. All
Microsoft haters can say whatever they want to say, but when it comes to ease of use and
productivity, Windows 7 has been the best operation system so far. Last week I was doing
some prototype on HTML5 and needed to zoom into some images to monitor rendering of canvas very closely. Well
I needed some application that could zoom my screen. As I expected, Windows 7 has this cool tool called
Magnifier. As the name suggests, this tool can be used to magnify your screen view to the
extent you want to accomplish what you want to by zooming into the image. For example, from the following
screen view, I want to zoom into red rectangle on the right.
After I use Magnifier, following view provides me the exact details about the rectangle that I was looking for.
How to use Magnifier Tool In Windows
You will find this tool under Start > Accessories > Ease of access menu. There
you will find a menu item Magnifier as shown in screenshot below.
- Command Line For Magniifer:
You can also launch Magnifier by typing
Magnify command in Run window as show in image below.
After you launch Magnifier, your view will be enlarged by 200% (default value). You will notice
a lens in the view that will follow your mouse movement. When you click on that lens it opens up
a dialog window where you can change zoom value as well as options for this tool.
After you are done using Magnifier, click on the lens to bring up the dialog box again and close it. It
will dismiss the tool as well.
Keyboard Shortcuts For Magnifier in Windows 7
|
Press this key
|
To do this
|
|
Windows logo key + Plus Sign (+) or Minus Sign (-)
|
Zoom in or out
|
|
Ctrl+Alt+Spacebar
|
Preview the desktop in full-screen mode
|
|
Ctrl+Alt+F
|
Switch to full-screen mode
|
|
Ctrl+Alt+L
|
Switch to lens mode
|
|
Ctrl+Alt+D
|
Switch to docked mode
|
|
Ctrl+Alt+I
|
Invert colors
|
|
Ctrl+Alt+arrow keys
|
Pan in the direction of the arrow keys
|
|
Ctrl+Alt+R
|
Resize the lens
|
|
Windows logo key + Esc
|
Exit Magnifier
|
Pretty cool and easy, eh!
by Naveen
7. July 2010 15:31
I had a very interesting experience when I tried to install Windows 7 on my desktop that has Windows XP 32bit installed on it. Well I knew that I could not simple upgrade a 32 bit OS to 64 bit OS. So it was going to be a dual boot on my machine. I downloaded Windows 7 64 bit DVD from MSDN. It was little naive of me to think that setup file on that DVD will actually run from 32 bit OS. Anyways, I gave it a try. That meant that I have to boot from my Windows 7 64 bit DVD. So I restarted the machine and chose of option of botting from CD/DVD. That did not go very well. The ISO download from MSDN was not bootable. And I could not find my DVD that Microsoft sent me as part of MSDN shipment. Well going by where there is will there is a way here is my work around to do Install Windows 7 64 bit on my Dell desktop.
So I came up with idea of first installing Windows Vista 64 bit on machine because I have boot CD for it. Well, that did not go very well. For some reason Dell desktops with SATA drives do not boot from MSDN disks. They always end up with BSOD. It has something to do with drivers for SATA drive that dell machines ship with. I knew Windows 7 boot disks work with dell machines. Luckily I had my Windows 7 N Edition (version that ships in Europe). So I went down the path of using that. And I got lucky with it. This DVD worked fine and I was able to install Windows 7 64 bit on my machine. One thing you want to do it not to choose the option of activating the serial number because I was about to upgrade this installation to regular Windows 7. Well now I came to know that you can not upgrade Winodws 7 N to Windows 7. Well that is ok because I did not need that installation anyways. Only thing I really needed was a 64 bit OS on my machine so I could launch set up files of regular Windows 7 64 bit. I inserted MSDN DVD for Windows 7 64 bit into the machine and went on with installation.
That was an interesting learning exercise for me.
by Naveen
3. June 2010 06:19
My laptop, using Windows7, has been running at very high CPU usage lately. Since I had multiple instances of high CPU
usage applications like Visual Studio, Expression, etc. open all the time, I did not suspect
anything. On top of that since I had mutiple processors in machine, I did not feel the pinch that much.
This morning I restarted the laptop and noticed that my CPU usage is running to about 75% with no
applications open. Well so I started my diagnostics.
Task Manager
First place to check for processes that may be using high CPU. I did not see any process that had
high CPU usage. Then I realized that this is Windows7 and I am not seeing processes for all users. So first
thing you need to do is click on Show processes for all users check box and make sure it
is checked. Now I was able to see all the process. And there it was the culprit. My machine had
spoolsv.exe process using 50% CPU. Since I have two processes, that would mean that
one of the processors is using all 100% resources.
Spoolsv.exe
Spoolsv.exe is a print spooler service used by Windows to manage print que on your machine.
This was another surprise for me because I was not printing anything on my laptop. Then why is this spooler
service running and taking up all the resources. Now I need to figure out what is going on with printing
documents on my machine.
What is printing?
To see what is printing on your Windows 7 machine, follow these steps.
-
Goto Start > Devices and Printers menu item.
-
This will bring up view where you can see all devices and printers attached to your machine. The
following screenshot shows how the view looks like on my laptop. Usually you may have
one or two printers in your list. Click on any of the printers you see in your list. Now you will
have See what's printing button show up in your toolbar. Click on it and it will
show you all documents in que for that printer.
-
If you see any documents waiting for printing or saying that they are printing, remove them
from printer's que. Go through each printer in the list and clean up the printing ques.
- Now go back to Task Manager and check CPU usage. There should not be any entry for
Spoolsv.exe and your machine's CPU usage should be back to normal.
Is Spoolsv.exe a virus or trojan?
If cleaning up printer ques does not help in bringing down CPU usage for Spoolsv.exe,
then you may want to entertain the notion that your windows machine may be infectd with
some virus or trojan. That would mean that it is time to run full scan on your machine and
clean it up.
by Naveen
31. March 2010 04:48
When you install DotNetNuke (in my case it was latest 5.3.1 release), you may run into the following exception and error when you try to launch the wizard for fresh install. This error can actually occur even after you have configured your DNN site correctly.
Server Error in '/DNN53' Application.
-------------------------------------
Security Exception
Description: The application attempted to perform an operation not allowed by
the security policy. To grant this application the required permission please
contact your system administrator or change the application's trust level in
the configuration file.
Exception Details:
System.Security.SecurityException: Request for the permission of type
'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed
The issue here is related how you created and configured your virtual directory or web application in IIS7 or higher. When creating a virtual directory in IIS on Windows 7, the default setting make use of DefaultAppPool. And that pool is configured to use Integrated Pipe Line as shown in the following screenshot. DNN framework does not seem to be configured and implemented to handle this integrated IIS pipeline and ends up throwing security exception. The
simple fix is to switch your application pool to use Classic .Net AppPool or if you have some other custom application pool that does not use Integrated pipe line.

by Viper
29. September 2009 05:40
In my previous post Fix STOP: 0x0000007B (OxF8968640, 0xC0000034, 0X00000000, 0x00000000),
I described come remedies to that problem. The thing that started the whole thing was the following message.
This copy of Windows must be activated with Microsoft before you can log on. Do you want to activate Windows now?
I had Windows XP Home installed on my Dell Latitude E6500 laptop. I decided to upgrade it to Windows XP Professional. The upgrade completed without any problems. After laptop was rebooted, I had my nice login screen come up with all the user accounts listed. I clicked on my account and I got the above message. Since I have valid user license for Windows XP Professional, I clicked on "Yes" on the dialog box. Nothing happened. Usually a wizard starts that walks you through activation steps. I tried rebooting few times, booted in safe mode, repaired my installation. Nothing worked at all. I thought I could log into safe mode to do activation. Well, it told me that I can not activate copy of windows in safe mode. I tried to reboot with "Safe mode with Networking Support". That did not go very well because operating system refused to do so telling me that I have to activate copy of the windows before I could do so. After digging around and calling my preferential technical support at microsoft, I came to know the following things and fix for the problem.
- Windows Activation Wizard Depends on Installation of Internet Explorer. So much for not forcing users to have to install IE.
- Upgrade from Windows XP Home Basic to Windows XP Professional wiped my previous installation of IE8
So from above two issues you can see that I am in catch 22 situation and there was no way that activation wizard was going to come up. So here is the solution to the problem.
- Goto another machine that has CD/DVD burner
- Download full installer of Internet Explorer 8 (IE8)
- Burn IE8 on CD/DVD
- Now log in into "Safe Mode" on machine with activation problem
- Insert CD with IE8 installer
- Install IE8 on the machine
- Reboot the machine
- Now when This copy of Windows must be activated with Microsoft before you can log on. Do you want to activate Windows now? message dialog box pops up, click "Yes"
- This should bring up activation wizard and you should be able to complete your activation of copy of windows and use your machine normally.
by Viper
28. September 2009 07:32
Two days ago I decided to upgrade my Dell Latitude E6500 laptop from Windows XP Home Basic to Windows XP Professional. I decided not to do a clean install and use Upgrade option at install time. It upgraded fine. When I tried to log into the machine, i got the error message that I need to activate this version of Windows before I could use it. Well that is another story. I tried few things and decided to do a clean install. So I inserted my boot disk and made the laptop boot from it. All the drivers copied fine and when it went to step of Starting Windows Executive, BAM. I get the dreaded BSOD with error code STOP: 0x0000007B (OxF8968640, 0xC0000034, 0X00000000, 0x00000000). Well, this is a new laptop and was botting fine when I upgraded OS version. So it did not seem logical to think that hard disk is corrupted or some controller is failing. I remember that I had similar issue couple of years ago when I tried to upgrade OS on one of my Dell Precision Workstation. Then it hit me that at that time the problem was because of SATA drivers not being loaded from Windows XP install CD. And I had to ask Dell for installer CD that was used on that desktop. When you see this kind of error when you do any of the following:
- Reinstall OS from disk other than manufacturer
- Change your hard disk configuration
- You got SATA/RAID drives
First try to see if you can find your original OS disk that came with the machine or ask the manufacturer for a new one. There are different solutions proposed like disabling SATA option in BIOS. I do not feel comfortable with those options because it may introduce issues that may affect performance of your machine. I will strongly suggest using disk that has appropriate disk drivers.
by Viper
23. September 2009 04:44
Every now and then you run into situations where you need to perform some command line action on your windows machine. And then you see this instruction along with other instructions for that operation. Note: corrective action requires Administrator privileges. This was not a problem till Windows XP because if your account was part of Administrators group you were granted the rights to perform that action. But on Windows7 that is not the case. Even if your account is part Administrators group, you are not running as Administrator. On Windows7 you have to use Run as administrator option to launch certain application.
To start a command prompt we all go to Start menu and use Run option to launch command window or in Windows7 you simply type Cmd in following window in start menu and hot enter.
This will start your command window but it will be running under your context and not as administrator. To get it to run as administrator, instead of hitting Enter, use following key combination and you will have your command window running as Administrator.
Shift + Enter
To confirm that your command window is running as administrator, you will see Administrator prefixed in the title of the command window as shown below.

by Viper
2. September 2009 06:02
Transition from Windows XP to Windows 7 has been raising new issues every day during development
of desktop as well as web applications. Most of these are not issues per se. They are changes that were introduced
during Windows Vista and are part of Windows 7 as well. This piece of information has to do
with network protocols on Windows 7. Here is what happened. I am developing a web application. One of the
things I had to do in the application is to check if the request URL is from localhost or loopback
address then do something different otherwise follow normal routine. So I was comparing Request.UserHostAddress with
standard loopback address of 127.0.0.1. It was working fine. Then I started an instance of IE and
tried to test the page. Well, nothing seemed to work. When I debugged the code, I saw that value of Request.UserHostAddress
was ::1 instead of 127.0.0.1. By looking at the IP address I could tell that it was standard IPv6
loop back IP address. Actually the loopback address on an IPv6 network is 0:0:0:0:0:0:0:1 which is abbreviated as ::1. Then
I paid close attention to IPAddress class in .Net framework. There is a method IsLoopback that you can
use to test for loopback address. And you will use Parse method to create instance of IPAddress object.
After making these changes, my implementation looked as below.
private void GetUserFromIp()
{
UserGeoLocator geoLocator = new UserGeoLocator();
_userLocation = null;
var ip = IPAddress.Parse(Request.UserHostAddress);
if (IPAddress.IsLoopback(ip) ||
string.Compare(Request.UserHostAddress, "127.0.0.1", 0) == 0)
{
_userLocation = geoLocator.GetUserLocationByIp("68.xxx.xxx.xxx");
}
else
{
_userLocation = geoLocator.GetUserLocationByIp(Request.UserHostAddress);
}
}
IPv6 is enabled by default on Windows Vista as well as Windows 7. If you use Visual Studio
Development Server to debug your application, you will notice that loopback address is in IPv4 format but if you use
IIS to debug your ASP.Net application, the loopback address is in IPv6 format. To avoid any issues like this, using
IsLoopback makes the implementation neutral to format because framework will take care of interpretting the IP
address correctly when you use Parse to create instance of IPAddress object.
You can diable use of IPv6 on Windows 7 by following instructions in
How to disable certain Internet Protocol version 6 (IPv6) components in Windows Vista, Windows 7 and Windows Server 2008. If you
are not using any format specific implementation, then you do not have to do that and I would not suggest doing it if you
are not comfortable dealing with changing registry entries.
by Viper
1. September 2009 11:28
I have been running Windows 7 for quite some time now. Lately I started seeing that every now and then machine will consume almost 100% CPU. Especially if machine resumes from hibernation it was taking few minutes to get it started completely and respond to mouse and keyboard events. So I started looking into Task Manager. I noticed that there was good amount of activity happening. And most of the activity was for operations that I did not care or I did not use or I did not know about. There were 2 processes that I am going to mention here.
Windows Media Player Network Sharing Service
I noticed that wmpncfg.exe process was consuming close to 35% of CPU. Then I looked in Service Control Manager and found this service. Interesting thing was that the service was configured to run Manually but it was already running. I never started it. This is what the description of this service says.
Shares Windows Media Player libraries to other networked players and media devices using Universal Plug and Play
If you are not using media player to share your content, then you really do not need to run this service. Change the status of this service to Disabled.
Feed Sync
Second process that i noticed was msfeedssync.exe. This process was actually waking up at regular interval and consuming all the resources. The name pretty much tells that it has something to do with news feed synchronization. I had configured Windows Mail to read some feeds some time back. But then I had removed it from there. Windows Mail also adds these feeds to Internet Explorer as well. You can click on the feeds in Internet Explorer by clicking on Favorites button. The left pane has a tab for Feeds. You can see in the image below that there is one entry for news feed.
Now click on Tools > Internet Option menu option. It will bring up Internet options dialog box. Click on Content tab. At the bottom of the view you will notice section Feeds and web slices. Click on Settings button. It will bring up following dialog box. Notice that by default all feeds are set to be synchronized every 15 minutes. Turn this off if you are not using IE as news reader or you want to synchronize the feeds manually.
After I made these 2 changes, I saw significant improvement in performance of my laptop.
|
|