March 18, 2012

Get Vista Style Drive Icons in Windows XP

One of the nice little features in Windows Vista that you don’t think about is the graph of drive space for your drive icons, so you can visually see at a glance how much space is used. There’s no reason to upgrade for this feature, especially since some programmers created a small utility for XP that gives you the same functionality.
You’ll notice the new icon looks very similar to the ones in Vista, but the more interesting addition is the new bar under the icon that gives you a tiny graph of the current drive space.
The graph will show up on most of the icon sizes other than the details view.
When your drive is running low on space the graph will turn red to indicate that you should probably stop downloading so much.
You can see in task manager that it really doesn’t use all that much memory.




March 13, 2012

We shall make a folder locked making password protected also hidden, so that any third-party can not access its contents. There are tons of software, available in the market to hide or lock your folder in Windows. But if some thing can be done without the help of a software then why should you use one? In this article, I’ve described the process to lock the folder by creating a simple Batch file.

How to create the batch file to lock a folder

1. Copy and paste the following codes in a notepad file.
cls
@ECHO OFF
title Folder Confidential
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Confidential goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Confidential "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter the Password to unlock folder
set/p "pass=>"
if NOT %pass%== Replace this Red portion with your password goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Confidential
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md confidential
echo Confidential created successfully
goto End
:End

2. Save the file as “Key.bat”. You are done. When you’ll double-click on the Key.bat file for first time, a folder “Confidential” will be automatically created. You can move all your confidential data in that folder.

Now to lock the folder just double-click on the file “Key”. You will get a confirmation message in Command Prompt. Type “y” to confirm. Now the folder “Confidential” will be locked and hidden.

If you want to get access to the contents of the folder then again double-click on the batch file, you have created. Immediately you will be prompted to enter your password. After that you can get access to the folder “Confidential”.

By this process you can password protect the folder and no body can get access to the folder without the password. But still there is some risk. If some body is a computer savvy then he can easily retrieve the password from your batch file. He can easily find the password by choosing “Edit” option from the right-click context menu.
So, to prevent from that option you can make an executable file of the batch file. The facility of the executable file is that no body can’t see the source code of an exe file. Here I’ve described the process of converting the batch file to executable(.exe) file.
At first you need a compiler that compiles the batch file to an executable file.
1. Download Bat to Exe converter
2. Now run the application and put the source path of the batch file, then the target executable file name with location.

3. Click on “Compile” button.
That’s all. Delete the batch file “key.bat”. You can now protect or access the folder by using the exe file (key.exe). Your data is now fully protected.
The above method works in XP, Vista and Windows 7.

How to Close Parent Form from Child Form in Windows Forms 2.0

With the MSDN forums flooded with similar questions, I decided to dedicate an article for the subject. In this article, we will create two forms, a parent and a child and then open the child form using the Parent Form. When the child form closes, we will close the Parent form too. Let us see how.
Step 1: Create a new Windows application. Open Visual Studio 2005 or 2008. Go to File > New > Project > Choose Visual Basic or Visual C# in the ‘Project Types’ > Windows Application. Give the project a name and location > OK.
Step 2: Add a new form to the project. Right click the project > Add > Windows Forms > Form2.cs > Add.
Step 3: Now in the Form1, drag and drop a button ‘btnOpenForm’ and double click it to generate an event handler. Write the following code in it. Also add the frm2_FormClosed event handler as shown below:
C#
        private void btnOpenForm_Click(object sender, EventArgs e)
        {
            Form2 frm2 = new Form2();
            frm2.FormClosed += new              
            FormClosedEventHandler
(frm2_FormClosed);
            frm2.Show();
            this.Hide();
        }
              
        private void frm2_FormClosed(object sender, 
        FormClosedEventArgs
e)
        {
            this.Close();
        }
VB.NET
      Private Sub btnOpenForm_Click(ByVal sender As Object, ByVal
      e As EventArgs)
                  Dim frm2 As Form2 = New Form2()
                  AddHandler frm2.FormClosed, AddressOf
                  frm2_FormClosed
                  frm2.Show()
                  Me.Hide()
      End Sub
      Private Sub frm2_FormClosed(ByVal sender As Object, ByVal e
      As
FormClosedEventArgs)
                  Me.Close()
      End Sub
The trick in this code is to create the FormClosedEventHandler delegate which represents the method that handles a FormClosed event, in our case, for Form2. We then subscribe to this event. So whenever Form2 closes, we close the parent form Form1 too.
That’s it. That was simple. Thanks to a guy called Anderj who shared this idea.
I hope you liked the article and I thank you for viewing it.