Author Archives: CooLMinE

Monitor for clipboard changes using AddClipboardFormatListener

Microsoft has added a new windows function to help monitor when the data in the clipboard has been changed. The new function is called AddClipboardFormatListener but sadly it is only available for Windows Vista and higher. If you are looking for a method that will work for earlier versions of Windows take a look at Monitor clipboard in C#.

The principle is the same with the older method. We need to add our window to the clipboard format listener list so it can receive the WM_CLIPBOARDUPDATE message.

In order to do that we need to pinvoke the AddClipboardFormatListener and RemoveClipboardFormatListener.

How to set a custom page zoom value in Google Chrome

By default Google Chrome has predefined values for the page zoom setting. But what happens if none of those values satisfy your needs ? Since Google Chrome doesn’t provide you with way to set your own custom value we will need to use a workaround to achieve that.

The following workaround works by modifying the HTML code of the settings page allowing you to add (or remove if needed) more options from the drop down list. Another advantage of this method is that it doesn’t require an extension to be installed therefore not consuming extra unneeded memory.

Lets get started!

Access Google’s Chrome settings page by visiting chrome://settings/.

How to display a progressbar in taskbar in C#

You might have noticed that programs display a progress bar in the taskbar a lot of times. This allows users to see the progression of the task even if the application is minimized by simply looking at the taskbar. Today I will be showing you a way to achieve that functionality so you can use it in your projects.

Taskbar progress bar

First you will need to download Windows API Code Pack for Microsoft .NET Framework. Extract the contents of the file and search for Microsoft.WindowsAPICodePack.Shell.dll which is located under the binaries folder.

Add Microsoft.WindowsAPICodePack.Shell.dll as a reference to your project. This will allow you to use the namespaces which are required in order to display the progress bar.

The code below is an example on how you can implement the feature.

How to make Firefox ask to save tabs on exit

Sadly the newer versions of Firefox no longer ask you if you want to save the open tabs when you close Firefox. This is probably because of the new feature that has been implemented in the general options which allows Firefox to always remember the open tabs and windows upon closing.

Firefox save windows and tabs option

But what happens if you don’t always want to save the open tabs ?

To get back the original functionality of Firefox, that used to show a message on exit asking if we want to save the open tabs or not we need to dig a bit in Firefox’s configuration settings.

  1. Type about:config in your address bar and press enter.
  2. There are three entries we are interested in (four if you are using Firefox 12 or higher).
    • browser.tabs.warnOnClose
    • browser.warnOnQuit
    • browser.warnOnRestart
    • browser.showQuitWarning (for Firefox 12 and higher)

    Search for each one individually and make sure that their value is set to true.

  3. Restart Firefox.

Now everytime you will close Firefox (assuming you have tabs open) you will get a message asking you if you want to save the current tabs or not.

Firefox save tabs message

Disable grey urls in Firefox’s address bar

Firefox 6 and higher support a new feature that will automatically color the domain name and the top level domain black, greying out the rest of the URL.

Since this feature is enabled by default in the latest versions you might want to disable it if you don’t like the way Firefox is displaying the URL in the address bar. If that is the case simply follow the steps below.

browser.urlbar.formatting.enabled (true)
Firefox url formatting color setting enabled

browser.urlbar.formatting.enabled (false)
Firefox url formatting color setting disabled

How to disable Firefox’s url formatting.

  1. Type about:config in your address bar and press enter.
  2. Search for browser.urlbar.formatting.enabled.
  3. Make sure the value is set to false.

The URL in the address bar should now be colored in black only.