Author Archives: CooLMinE

Microsoft Update KB2823324 has been recalled

windows-logoMicrosoft has recalled one of their recent windows updates yesterday. The update was causing a lot of Windows 7 systems to have a blue screen (0xc000021a Stop error) or generate event errors with ID 55 and may even cause your system to not be able to boot upon restart.

Microsoft has already removed the update from windows updates list and they are recommending their users to uninstall the update from their systems if they have already installed it. For more information and step by step instructions on how to remove the update visit http://support.microsoft.com/kb/2839011

Disable all caps menus in Microsoft Visual Studio 2012

If you are interested in changing the Visual Studio’s 2012 menu from this

Visual Studio 2012 menu all caps

to this

Visual Studio 2012 menu normal
Follow the instructions below.

How to disable all caps.

  1. Open up regedit. (Start -> Run -> Type regedit)
  2. Navigate to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\General.
  3. Add a new DWORD value with the name SuppressUppercaseConversion.
  4. Set its hexadecimal value to 1.

That is all, simply restart Visual Studio and the menu should not be in all caps now.

Monitor clipboard in C#

The best way of monitoring the data in the clipboard through your application is by adding your application’s window to the chain of clipboard viewers so it can receive the WM_DRAWCLIPBOARD message when the clipboard data is modified.

In order to do that we need to make use of the Windows SetClipboardViewer and ChangeClipboardChain APIs in order to monitor when the WM_DRAWCLIPBOARD message triggers.

First we will need to pinvoke SetClipboardViewer and ChangeClipboardChain and WM_DRAWCLIPBOARD and also set the variables that will hold the value for the next window in the chain that is required when we will want to stop our window from monitoring the clipboard. Place the following in your class.

UDP hole punching implementation in C#

UDP hole punching is a method that is used to establish connectivity between two hosts that are behind a NAT (router) without the need of having the clients port forward specific ports.

When the client sends a UDP packet to the server the router creates a temporary rule mapping, the server then uses the incoming IP address and port it receives the message from to send a message to the client, which refreshes (in most cases) the lifetime of the temporary mapping on the client’s router and allows the server to communicate constantly with the client without the need for the user to do anything from their side.

This method is also used to send messages between two users that are behind different NAT’s. The difference in the implementation is that the clients first contact with the server, which should have a port open in order to be able to receive the information from the clients. After the server receives the information from the clients it sends each client the IP and port of the other client, allowing both of them to communicate with each other.

I’ve created a small example on how the implementation of a UDP hole punching looks in C#, this should give you the general idea of how it works and let you expand it as you like. The example simply receives a message from the client then sends a response. If you want the server to handle more than one message then you will need to add some loops.

Force Firefox 20 to use the old download manager

Mozilla released Firefox 20 a few days ago that came with various new features such as:

  • a new per-window Private Browsing feature
  • a new download manager
  • the ability to close unresponsive plugins without the need to restart the browser

Sadly my personal opinion about the new download manager feature isn’t very good. The new manager seems to be very user unfriendly and from what I can see there isn’t an option in the settings to clear a download file from the history automatically after the file has been downloaded. Luckily there is an easy solution for this for those that would like to revered back to the old download manager design.

  1. Type about:config in your address bar
  2. Search for browser.download.useToolkitUI
  3. Set its value to true

Now everytime you download something the old version of the download manager will start instead of the new one.

browser.download.useToolkitUI

If you also want to remove the new download button that was added in this new version simply right click on the bar, click Customize… and drag and drop the button you don’t want into the customize toolbar list that will appear.