Index: /trunk/Launcher/Launcher.cpp
===================================================================
--- /trunk/Launcher/Launcher.cpp	(revision 36)
+++ /trunk/Launcher/Launcher.cpp	(revision 37)
@@ -1,9 +1,9 @@
-//
-// -disk k:\ -method random 1 -results
-//
 // Launcher.cpp
+// $Id$
 //
 // Eraser. Secure data removal. For Windows.
 // Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+// Copyright © 2001-2006  Garrett Trant (support@heidi.ie).
+// Copyright © 2007 The Eraser Project.
 //
 // This program is free software; you can redistribute it and/or
@@ -466,12 +466,22 @@
 	}
 
+	// is the user naive enough to select the first/last 2KB pass with free space?
+	if (emMethod == ERASER_METHOD_FIRST_LAST_2KB && bDrive)
+	{
+		AfxMessageBox("The first/last 2KB erase cannot be used with Free Space erases.", MB_ICONERROR);
+		return FALSE;
+	}
+
 	//Now that the command line has been passed, check if we should display the
 	//results dialog (because it may not be overridde by the user)
 	CKey kReg;
-	kReg.Open(HKEY_CURRENT_USER, ERASER_REGISTRY_BASE);
-	if (bResults == -1)
-		kReg.GetValue(bResults, ERASER_REGISTRY_RESULTS_FILES, TRUE);
-	if (bResultsOnError == -1)
-		kReg.GetValue(bResultsOnError, ERASER_REGISTRY_RESULTS_WHENFAILED, FALSE);
+	if (kReg.Open(HKEY_CURRENT_USER, ERASER_REGISTRY_BASE))
+	{
+		if (bResults == -1)
+			kReg.GetValue(bResults, ERASER_REGISTRY_RESULTS_FILES, TRUE);
+		if (bResultsOnError == -1)
+			kReg.GetValue(bResultsOnError, ERASER_REGISTRY_RESULTS_WHENFAILED, FALSE);
+		kReg.Close();
+	}
 
 	try
Index: /trunk/KeyComboDlg.cpp
===================================================================
--- /trunk/KeyComboDlg.cpp	(revision 36)
+++ /trunk/KeyComboDlg.cpp	(revision 37)
@@ -26,5 +26,5 @@
 #include "KeyComboDlg.h"
 #include <shared/key.h>
-
+#include <commctrl.h>
 
 const LPCTSTR szAccelerKey = "Acceler";
@@ -92,19 +92,35 @@
 	// function and call CRichEditCtrl().SetEventMask()
 	// with the ENM_CHANGE flag ORed into the mask.
-
-	// TODO:  Add your control notification handler code here
-	//char cLine[10];
 	char ch[10];
 	m_eKey.GetLine(0,ch,1);
 	CString strLine(ch);
-	if (!strLine.IsEmpty())
+	static bool busy = false;
+	if (busy)
+		return;
+	busy = true;
+
+	if (!strLine.Trim().IsEmpty())
 	{
 		CString strTmp(m_strRegKey.MakeUpper());
 		strLine.MakeUpper();
-		if (strTmp.Find(strLine[0]) ==-1 ) {
-			m_eKey.Undo();
-			m_eKey.SetWindowText("");
+		if (strTmp.Find(strLine[0]) == -1) {
+			//Invalid selection, clear the entry
+			m_eKey.SetWindowText("m");
+
+			//TODO: This works only with XP/Vista. What about others?
+			EDITBALLOONTIP ebtt;
+			ZeroMemory(&ebtt, sizeof(ebtt));
+			ebtt.cbStruct = sizeof(ebtt);
+			ebtt.pszTitle = L"Invalid shortcut";
+			ebtt.ttiIcon = TTI_ERROR;
+
+			strTmp = "The shortcut value must be one of the characters " + strTmp;
+			ebtt.pszText = new wchar_t[strTmp.GetLength() + 1];
+			mbstowcs((wchar_t*)ebtt.pszText, strTmp.GetBuffer(), strTmp.GetLength() + 1);
+			
+			m_eKey.SendMessage(EM_SHOWBALLOONTIP, 0, (LPARAM)&ebtt);
+			delete[] ebtt.pszText;
 		}
 	}
-
+	busy = false;
 }
Index: /trunk/Eraser.vcproj
===================================================================
--- /trunk/Eraser.vcproj	(revision 36)
+++ /trunk/Eraser.vcproj	(revision 37)
@@ -54,5 +54,5 @@
 				Optimization="0"
 				AdditionalIncludeDirectories="./"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_WIN32_IE=0x600;_WIN32_WINNT=0x600"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -148,5 +148,5 @@
 				Optimization="0"
 				AdditionalIncludeDirectories="./"
-				PreprocessorDefinitions="_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				PreprocessorDefinitions="_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_WIN32_IE=0x600;_WIN32_WINNT=0x600"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -243,5 +243,5 @@
 				Optimization="2"
 				AdditionalIncludeDirectories="./"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_WIN32_IE=0x600;_WIN32_WINNT=0x600"
 				StringPooling="true"
 				ExceptionHandling="2"
@@ -340,5 +340,5 @@
 				Optimization="2"
 				AdditionalIncludeDirectories="./"
-				PreprocessorDefinitions="NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				PreprocessorDefinitions="NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_WIN32_IE=0x600;_WIN32_WINNT=0x600"
 				StringPooling="true"
 				ExceptionHandling="2"
