Tools

I hate that Home Screen which pops up on every Skype start. I really do…
So I created a small Tray Icon app which looks for this Window and closes it immediately.

As usual, there is some Win32 API needed to do this. Here’s the Code which searches and closes the Window:

[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr FindWindow(string strClassName, string strWindowName);
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);

public const Int32 WM_SYSCOMMAND = 0x0112;
public const Int32 SC_CLOSE = 0xF060;

public static void Close()
{
	IntPtr hWnd = FindWindow("THomeForm", "Skype Home");
	if (hWnd.ToInt32() > 0)
	{
		SendMessage(hWnd, WM_SYSCOMMAND, new IntPtr(SC_CLOSE), IntPtr.Zero);
	}
}

Here’s the programm: SkypeHomeCloser_1.0

Code printed in Visual Studio 2010 is not colored.
To enable this “feature”, you have to install this Extension.
Be aware that you can’t collapse regions for printing with this Extension.
Furthermore, if you wan’t line numbers, you have to enable them via Tools->Options.

I always forget how to Rollback a Changeset, so here’s the command to do it:

First, make sure you got the Team Foundation Server Power Tools installed.

Then execute the following command:

tfpt rollback /changeset:<changesetnumber> "<workspace>"

so for example:

tfpt rollback /changeset:48745 "C:\Workspaces\XXXComplete"

For quite some time now, it has happened to me occasionally that attaching the debugger to the w3wp.exe (IIS worker process) to debug a web application gets extremely slow. I’m talking about several minutes to load all the symbols before it could actually start debugging. In the VS status bar you could see that it took about 1 second for each assembly to load – and we’ve got LOTs of them. In the past, the problem usually went away by itself after a reboot or some other Windows “feature”. This week however it just didn’t get any better. After some Googleing I now think that I have found the solution to the problem: simply delete ALL breakpoints and set a couple of new ones. Don’t ask me how or why exactly, but it seems to be quite reliable.

I often get an Not enough storage is available to complete this operation Error when compiling a large Solution. By storage they mean Memory (RAM) in fact.
Visual Studio is limited by how much RAM it will use but theres a trick to increase the Memory it will use.

Quick HowTo:
1.
Windows xp: backup the boot.ini file and then put the /3gb switch in your boot.ini.
Windows Vista: run the following from the visual studio command prompt:
bcdedit /set increaseuserva 3072

2.
– be sure to backup devenv.exe
– using the visual studio command prompt, navigate to c:\program files\microsoft visual studio 9\common7\ide\
– execute the following command:
editbin /largeaddressaware devenv.exe

Here’s the Link to the original entry:

http://stevenharman.net/blog/archive/2008/04/29/hacking-visual-studio-to-use-more-than-2gigabytes-of-memory.aspx

There is this fancy new feature in Windows 7 called “Boot from VHD”. It essentially allows you to boot your machine from a virtual disk without having to virtualize the rest of your hardware. This can be quite helpful if you want to experiment with your Win7 without reinstalling all the time because you screwed up.

First I’ll explain how you can create and manage virtual disks. In the second part I will discuss how to install a second Win7 on the created virtual disk and how to set up the bootloader correctly.
Continue reading Win7 Boot from VHD – Part I

On Friday I tried to update one of the legacy DataSets of the application I’m working on. When I double-clicked the data set schema, VS just opened the XML view to edit the schema. Quite useless. So I right-clicked the item and selected “View Designer” which then brought up a new window that contained all the inner text of the XML document as one large blob. More than just useless…
Today I started looking for a solution or possible cause for the problem. It would seem that the data set designer was not loaded on VS startup. The solution then was quite simple: Open a command line and start

devenv /resetskippkgs

This tells VS to reset its list of skipped packages and load everything. Now I can use the designer again.