Skip to content

Instantly share code, notes, and snippets.

View stuartd's full-sized avatar
💭
job seeking

stuartd stuartd

💭
job seeking
  • Brighton, UK
View GitHub Profile
// Adapted from http://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode
namespace Utilities
{
public struct HashCode
{
private readonly int hashCode;
private HashCode(int hashCode)
{
this.hashCode = hashCode;
using System;
using System.Runtime.InteropServices;
using System.Threading;
using EnvDTE;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace DteTestClassNamespace
{
[TestClass]
public class DteTestClass
IntPtr hWnd = IntPtr.Zero;
Process currentProcess = Process.GetCurrentProcess();
Process[] processes = Process.GetProcessesByName(currentProcess.ProcessName);
foreach (Process process in processes)
{
// Get the first instance that is not this instance, has the
// same process name and was started from the same file name
// and location.
// Also check that the process has a valid