Debug messages now conditionally compiled only in debug builds.

This commit is contained in:
Lorenz Cuno Klopfenstein 2010-07-01 12:50:55 +02:00
parent 06f2013f9e
commit 3924fa7d0b
3 changed files with 18 additions and 4 deletions

View file

@ -203,7 +203,10 @@ namespace OnTopReplica {
//ESCAPE
else if (e.KeyCode == Keys.Escape) {
Console.WriteLine("Received ESC");
#if DEBUG
Console.WriteLine("Received ESCAPE");
#endif
//Disable click-through
if (ClickThroughEnabled) {

View file

@ -21,7 +21,9 @@ namespace OnTopReplica {
_processors.Add(t, instance);
#if DEBUG
Console.WriteLine("Registered message pump processor: {0}", t);
#endif
}
}
}

View file

@ -26,7 +26,7 @@ namespace OnTopReplica.MessagePumpProcessors {
//Enable new hook
if (!_active) {
if (!HookMethods.RegisterShellHookWindow(Form.Handle)) {
Console.WriteLine("Failed to register shell hook window.");
Console.Error.WriteLine("Failed to register shell hook window.");
return;
}
}
@ -41,7 +41,7 @@ namespace OnTopReplica.MessagePumpProcessors {
return;
if (!HookMethods.DeregisterShellHookWindow(Form.Handle))
Console.WriteLine("Failed to deregister shell hook window.");
Console.Error.WriteLine("Failed to deregister shell hook window.");
_active = false;
}
@ -53,7 +53,6 @@ namespace OnTopReplica.MessagePumpProcessors {
hookCode == HookMethods.HSHELL_RUDEAPPACTIVATED) {
IntPtr activeHandle = msg.LParam;
Console.WriteLine("New foreground: {0}", activeHandle);
HandleForegroundWindowChange(activeHandle);
}
}
@ -66,17 +65,27 @@ namespace OnTopReplica.MessagePumpProcessors {
iActive = i;
}
#if DEBUG
Console.Write("New active window (h {0}). ", activeWindow);
#endif
if (iActive < 0) {
#if DEBUG
//new foreground window is not tracked
Console.WriteLine("Active window is not tracked.");
#endif
return;
}
//Get new handle to clone
int iNewToClone = (iActive + 1) % _handles.Count;
#if DEBUG
Console.WriteLine("Tracked as {0}. Switching to {1}.", iActive, iNewToClone);
#endif
//TODO: use real least-recently-used semantics
Form.SetThumbnail(_handles[iNewToClone], null);
}