Archive for July, 2008

Hiding Unnecessary Sidebar of Google Reader

I am a hard fan of Google Reader. It’s the best online reader I’ve ever used. The great advantage is that I can read the archived posts of a feed while most of the other readers offer latest posts offered by the blog owner. OK let me stop boasting about Google reader features.

My laptop is Dell XPS M1330 which has a native resolution 1280×800. I’m visiting Google Reader than any other web sites in my daily surfing. Nearly 170pix my precious 800 pixel screen height has been occupied by sidebar area which shows shared items and other information of my reader.

Sidebar

I rarely use these features. Instead, I could save my for scrolling the long list and also pleasing for my eye if the subscription tree occupies the space of this unused part.

I just wrote two scripts to hide this rarely used area( I intentionally omitting friends’ shared items). I’m not a scripting or web expert but on seeing other scripts I managed to write some CSS code to hide the shared item area.

Here’s the steps to hide the shared item area. I believe you’re using Firefox and heard about GreaseMonkey or Stylish addon.

1. Install Stylish or Grease Monkey from its web site

2. Download my script from userstyles.org. There I’ve uploaded two scripts. First one to hide shared items area, the next one hides shared item area and Add subscription option as well

Please check the screen shots and verify the script as well. For the sake of privacy I’ve blurred the subscription tree. The actual code may not render the content similar to screen shot provided in the userstyle.org web site. Use it at your own risk. Enjoy some extra space with Google Reader!!!


How to specify a network path to FindFirstFile API

Sometimes might have used following code snippet to check whether a file existing or not.

WIN32_FIND_DATA fdt;
HANDLE hFile = ::FindFirstFile( _T("C:\\Downloads"),&
fdt);

The above code may succeed if you give a valid local path in your HDD.

Sometimes you may need to check a share in network existing or not. So What would you do? You may write something as follows

//Try with network file path
WIN32_FIND_DATA fdt;
HANDLE hFile = ::FindFirstFile( _T("\\\\writer\\Downloads"),&fdt);

What’s wrong with above code? The code would fail and return error code 0×35(53) (Use GetLastError()).(Error Message: “The network path was not found”)

As per the documentation, giving path of a network share is a bit different.

On network shares, you can use an lpFileName in the form of the following: “\\server\service\*”. However, you cannot use an lpFileName that points to the share itself; for example, “\\server\service” is not valid.

So the following code will work fine for you

WIN32_FIND_DATA fdt;
HANDLE hFile = ::FindFirstFile( _T("\\\\writer\\Downloads\\*"),&fdt);

We have a simple and smart way to check the existance of a file or path with a simple API. As you see below.

//Try with Shell API
if( PathFileExists(_T("\\\\writer\\Downloads") ) )
{
MessageBox( _T( "Succeed to find file" ));
};


  • Translate to yours!

  • Keep this running!

  • The People!

  • If I’ve proven, be connected

  • Recent Posts

  • Pages

  • Copyright © 1996-2010 Reflections of my thoughts..... All rights reserved.