Tuesday, July 26, 2011

Explorer.EXE Crashes and Restarts Constantly

After a reboot, Windows Explorer began to crash and restart constantly with an Event ID 1000 error. Windows Help was useless, so I opened Event Viewer and saw the following:



It's curious that a file which is part of the third-party Windows 7 Codec pack seems to be responsible:
Faulting module path: C:\Program Files\Win7codecs\filters\DivXMFSource.DLL

Fortunately, I got around this issue by simply uninstalling the codec pack as described here, by executing the file Win7codecs.msi in a subfolder contained immediately under C:\ProgramData\Win7codecs\, and then choosing Remove (the only option available via Control Panel \ Programs \ Programs and Features is to perform a "Repair", which didn't help in my case).



Saturday, July 9, 2011

Create Shortcut to Executable using C#

I needed a C# method to create a shortcut to an executable and place it on the user's desktop in Windows.

I found a method to actually create the shortcut which utilizes the Windows Scripting Host object model. Most examples I found used a separate icon file for the shortcut, whereas I wanted to have the shortcut icon by default be the same one used by the executable itself.

First you must create a reference in Visual Studio to the Windows Script Host Object Model COM object as shown here:



Below is the modified method, where sLinkPathName is the path to the executable.

using IWshRuntimeLibrary

...

private void appShortcutToDesktop(string sLinkPathName)
{
     try
     {
          WshShellClass wsh = new WshShellClass();
          IWshRuntimeLibrary.IWshShortcut scShortcut;

          // Choose the path for the shortcut
          scShortcut = wsh.CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\shorcut.lnk") as IWshRuntimeLibrary.IWshShortcut;

          // Where the shortcut should point to
          scShortcut.TargetPath = txtFile.Text;

          // Description for the shortcut
          scShortcut.Description = "This is a shortcut.";

          // Location for the shortcut's icon
          scShortcut.IconLocation = sLinkPathName + ", 0";

          // Create the shortcut at the given path
          scShortcut.Save();
     }
     catch (Exception ex)
     {
          MessageBox.Show(ex.Message);
     }
} 

Line 22 sets the shortcut's IconLocation property such that it grabs the default icon for the executable, the same one that you'd expect to see if you created the shortcut manually.



Saturday, July 2, 2011

Google +1 Button: Instant SEO

Google's new +1 button is the information innovator's response to the fairly ubiquitous Facebook, StumbleUpon, and other icons that let you promote content you find useful. I noticed that Google incorporated this feature into my search results as well, so I decided to experiment.

A popular blog post of mine describing a DIY screen protector for the Viewsonic G Tablet appears at spot #9 among my Google search results as shown below:



Note the greyed out +1 button just to the right of the link title, which animates tantalizingly as you hover over the search result. I went ahead and clicked it, essentially voting my link up in the rankings. Here's the result:





From the #9 to the #5 spot with one click?? I'll take it! You also receive a notification just below and to the left indicating that you've +1'd a given link.

I don't know whether "+1'd" has as catchy a ring to it as "Liked", but if it brings more traffic to my site, then I'm all for it!


Tuesday, June 7, 2011

Viewsonic G Tablet DIY Screen Protector

I recently purchased the Viewsonic G Tablet. Once you dump the factory ROM, it's great, but unfortunately its glossy surface is a fingerprint magnet and the glare can be pretty bad in bright light.


  
There are some commercially available, custom fit, and relatively expensive screen protectors out there, but paying upwards of $20 for a transparent piece of floppy plastic is a bit overkill in my mind. Another quite effective and relatively inexpensive solution to protect the screen involves using frisket film, a clear, nearly transparent adhesive film used for tracing, stencils, and related tasks.

I opted for the cheaper route. Care to try it? 

Here's how.

First get some matte frisket film. The "low tack" variety works just fine; it adheres snugly, yet can be easily peeled away without leaving residue. You can print out this template as a guide. Use some paper clips to secure the roughly 9 x 12" frisket film to the template. Then, using a sharp razor or knife, carefully cut along the whitespace between the inner and outer black borders. After cutting, you can trim the corners of the film to accommodate the curves of the tablet, and also cut out a notch for its built-in camera.

Thoroughly clean the surface of the tablet with a damp, lint-free cloth to remove dust and hair. Then, put on a pair of powder-free surgical gloves (latex or non depending on whether you're allergic or not), remove the backing from the frisket film.

Carefully apply the film onto the tablet surface. It helps to have a straightedge handy for this process. Begin with one edge and even up the border of the film with that of the tablet, then carefully smooth the film onto the surface of the tablet, and with a very careful scraping action use the straightedge to apply the film.

Bubbles may form, but some of these you'll be able to work out by carefully "massaging" the film's surface. Over time, any remaining bubbles that are tiny (roughly the size of pinholes) should gradually fade away.

I did notice that the translucence of the film did detract, but only slightly, from the sharpness of the text, but the photo below doesn't do the film justice. The touch sensitivity is just as good as it was prior to applying the film, and over time I'm guessing the minute bubbles will fade away.



Given that each sheet of frisket film in a 12 pack ends up costing around $1.25 apiece, the future prospect of replacing a worn film is far better than the initial cost of an expensive precut film. In this case, a little work means a lot of savings, as well as reducing glare without compromising the sensitivity of the Viewsonic G Tablet touch screen.