[Roam-commit] SF.net SVN: roam: [81] Trunk/Source
Status: Alpha
Brought to you by:
jonfroehlich
|
From: <jon...@us...> - 2007-07-16 06:41:28
|
Revision: 81
http://roam.svn.sourceforge.net/roam/?rev=81&view=rev
Author: jonfroehlich
Date: 2007-07-15 23:41:26 -0700 (Sun, 15 Jul 2007)
Log Message:
-----------
added EnumWindows test
Modified Paths:
--------------
Trunk/Source/Roam/Utils/ProcessUtils.cs
Trunk/Source/Roam.Common/Utils/TypeUtils.cs
Trunk/Source/Roam.Common/Utils/WindowUtils.cs
Trunk/Source/Roam.Test/Roam.Test.csproj
Trunk/Source/Roam.Test/Utils/KeySnifferTest.Designer.cs
Trunk/Source/Roam.Test/Utils/KeySnifferTest.cs
Trunk/Source/Roam.UI/Controls/ScrollableLabel.cs
Trunk/Source/Roam.UI/Utils/KeySniffer.cs
Trunk/Source/Roam.suo
Added Paths:
-----------
Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.Designer.cs
Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.cs
Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.resx
Trunk/Source/Roam.Test/Sandbox/PingTest.Designer.cs
Trunk/Source/Roam.Test/Sandbox/PingTest.cs
Trunk/Source/Roam.Test/Sandbox/PingTest.resx
Modified: Trunk/Source/Roam/Utils/ProcessUtils.cs
===================================================================
--- Trunk/Source/Roam/Utils/ProcessUtils.cs 2007-07-01 22:43:14 UTC (rev 80)
+++ Trunk/Source/Roam/Utils/ProcessUtils.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -24,13 +24,6 @@
/// </summary>
/// <author>Jon Froehlich</author>
/// <author>Mike Y. Chen</author>
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
public static class ProcessUtils
{
#region P/Invoke Code
@@ -41,21 +34,6 @@
///
/// </remarks>
/// <author>Jon Froehlich</author>
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
- //class for PROCESSINFO struct pinvoke
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
public class ProcessInfo
{
public IntPtr hProcess;
Modified: Trunk/Source/Roam.Common/Utils/TypeUtils.cs
===================================================================
--- Trunk/Source/Roam.Common/Utils/TypeUtils.cs 2007-07-01 22:43:14 UTC (rev 80)
+++ Trunk/Source/Roam.Common/Utils/TypeUtils.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -42,34 +42,12 @@
/// <summary>
/// Returns true if type1 is the same type as type2 OR if type1 is a
- /// <summary>
- ///
/// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
- /// subclass of type2
- /// </summary>
/// <param name="type1"></param>
/// <param name="type2"></param>
/// <returns></returns>
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
public static bool EqualsOrSubclassOf(Type type1, Type type2)
{
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
return type1 == type2 || type1.IsSubclassOf(type2);
}
@@ -83,24 +61,10 @@
return ParseNamespace(type.FullName);
}
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
public static string CombineNamespace(String strNamespace, String className)
{
String strReturn = strNamespace;
if (strNamespace[strNamespace.Length - 1] != '.') { strReturn += "."; }
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
return strReturn + className;
}
Modified: Trunk/Source/Roam.Common/Utils/WindowUtils.cs
===================================================================
--- Trunk/Source/Roam.Common/Utils/WindowUtils.cs 2007-07-01 22:43:14 UTC (rev 80)
+++ Trunk/Source/Roam.Common/Utils/WindowUtils.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -30,6 +30,26 @@
/// <author>Jon Froehlich</author>
public static class WindowUtils
{
+ /// <summary>
+ /// The EnumWindows function enumerates all top-level windows on the screen by passing the handle to each window,
+ /// in turn, to an application-defined callback function. EnumWindows continues until the last top-level window
+ /// is enumerated or the callback function returns FALSE.
+ /// </summary>
+ /// <param name="enumWindowsProc">[in] Pointer to an application-defined callback function. For more information, see EnumWindowsProc. </param>
+ /// <param name="lParam">[in] Specifies an application-defined value to be passed to the callback function. </param>
+ /// <returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
+ /// To get extended error information, call GetLastError. If EnumWindowsProc returns zero, the return value is also zero.
+ /// In this case, the callback function should call SetLastError to obtain a meaningful error code to be returned to the
+ /// caller of EnumWindows.
+ /// </returns>
+ /// <remarks>
+ /// The EnumWindows function does not enumerate child windows, with the exception of a few top-level windows owned
+ /// by the system that have the WS_CHILD style. This function is more reliable than calling the GetWindow function
+ /// in a loop. An application that calls GetWindow to perform this task risks being caught in an infinite loop or
+ /// referencing a handle to a window that has been destroyed.
+ /// </remarks>
+ [DllImport("coredll.dll", SetLastError = true)]
+ public static extern int EnumWindows(IntPtr lpEnumFunc, uint lParam);
public static bool ContainsHandle(IntPtr handle, Control control)
{
@@ -112,63 +132,88 @@
Control controlFocused = FindFocusedControl(control);
if (controlFocused == null)
{
- Debug.WriteLine(String.Format("Could not find any focused controls in Name: {0} Type: {1} Handle: {2} or any of its children", control.Name, control.GetType().FullName, control.Handle));
+ Debug.WriteLine(
+ String.Format("Could not find any focused controls in Name: {0} Type: {1} Handle: {2} or any of its children",
+ control.Name, control.GetType().FullName, control.Handle));
}
else
{
- Debug.WriteLine(String.Format("Focused control: Name: {0} Type: {1} Handle: {2}", controlFocused.Name, controlFocused.GetType().FullName, controlFocused.Handle));
+ Debug.WriteLine(
+ String.Format("Focused control: Name: {0} Type: {1} Handle: {2}",
+ controlFocused.Name, controlFocused.GetType().FullName, controlFocused.Handle));
}
}
public static Control FindFocusedControl(Control control)
{
- if (control.Focused)
- {
- return control;
- }
- else
- {
- return FindFocusedControl(control.Controls);
- }
+ if (control.Focused) { return control; }
+ else { return FindFocusedControl(control.Controls); }
}
public static Control FindFocusedControl(Control.ControlCollection controls)
{
foreach (Control control in controls)
{
- if (control.Focused)
- {
- return control;
- }
+ if (control.Focused) { return control; }
Control c = FindFocusedControl(control.Controls);
- if (c != null)
- {
- return c;
- }
+ if (c != null) { return c; }
}
return null;
}
- //HWND GetForegroundWindow(void);
+ /// <summary>
+ /// The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working).
+ /// The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
+ /// </summary>
+ /// <returns>The return value is a handle to the foreground window. The foreground window can be NULL in certain circumstances,
+ /// such as when a window is losing activation. </returns>
[DllImport("coredll.dll", SetLastError = true)]
public static extern IntPtr GetForegroundWindow();
- //int GetWindowText(
- // HWND hWnd,
- // LPTSTR lpString,
- // int nMaxCount
- //);
+ /// <summary>
+ /// The GetWindowText function copies the text of the specified window's title bar (if it has one) into a buffer.
+ /// If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve
+ /// the text of a control in another application.
+ /// </summary>
+ /// <param name="hWnd">[in] Handle to the window or control containing the text.</param>
+ /// <param name="lpString">[out] Pointer to the buffer that will receive the text. If the string is as long or longer than the buffer,
+ /// the string is truncated and terminated with a NULL character. </param>
+ /// <param name="nMaxCount">[in] Specifies the maximum number of characters to copy to the buffer, including the NULL character.
+ /// If the text exceeds this limit, it is truncated. </param>
+ /// <returns>If the function succeeds, the return value is the length, in characters, of the copied string, not including
+ /// the terminating NULL character. If the window has no title bar or text, if the title bar is empty, or if the window
+ /// or control handle is invalid, the return value is zero. To get extended error information, call GetLastError.
+ /// This function cannot retrieve the text of an edit control in another application.
+ /// </returns>
[DllImport("coredll.dll", SetLastError = true)]
- public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
+ private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
+ public static string GetWindowText(IntPtr hWnd)
+ {
+ return GetWindowText(hWnd, 1000);
+ }
- //HWND GetWindow(
- // HWND hWnd,
- // UINT uCmd
- //);
+ public static string GetWindowText(IntPtr hWnd, int nMaxCount)
+ {
+ StringBuilder sb = new StringBuilder(nMaxCount);
+ GetWindowText(hWnd, sb, sb.Capacity);
+ return sb.ToString();
+ }
+
+ /// <summary>
+ /// The GetWindow function retrieves a handle to a window that has the specified relationship (Z-Order or owner) to the specified window.
+ /// </summary>
+ /// <param name="hWnd">[in] Handle to a window. The window handle retrieved is relative to this window, based on the value of the uCmd parameter. </param>
+ /// <param name="uCmd"></param>
+ /// <returns></returns>
[DllImport("coredll.dll")]
public static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd);
+
+ public static IntPtr GetChildWindow(IntPtr hWnd)
+ {
+ return GetWindow(hWnd, GetWindowConstants.GW_CHILD);
+ }
}
/// <summary>
Modified: Trunk/Source/Roam.Test/Roam.Test.csproj
===================================================================
--- Trunk/Source/Roam.Test/Roam.Test.csproj 2007-07-01 22:43:14 UTC (rev 80)
+++ Trunk/Source/Roam.Test/Roam.Test.csproj 2007-07-16 06:41:26 UTC (rev 81)
@@ -57,6 +57,7 @@
<Reference Include="mscorlib" />
<Reference Include="OpenNETCF, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e60dbea84bb431b7, processorArchitecture=MSIL" />
<Reference Include="OpenNETCF.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e60dbea84bb431b7, processorArchitecture=MSIL" />
+ <Reference Include="OpenNETCF.Net, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e60dbea84bb431b7, processorArchitecture=MSIL" />
<Reference Include="OpenNETCF.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e60dbea84bb431b7, processorArchitecture=MSIL" />
<Reference Include="OpenNETCF.WindowsCE, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e60dbea84bb431b7, processorArchitecture=MSIL" />
<Reference Include="System" />
@@ -73,6 +74,12 @@
<Compile Include="Media\SoundLoopPlayerTest.Designer.cs">
<DependentUpon>SoundLoopPlayerTest.cs</DependentUpon>
</Compile>
+ <Compile Include="Sandbox\EnumWindowsTest.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Sandbox\EnumWindowsTest.Designer.cs">
+ <DependentUpon>EnumWindowsTest.cs</DependentUpon>
+ </Compile>
<Compile Include="Sandbox\PhoneButtonManager.cs" />
<Compile Include="Sandbox\Camera.cs">
<SubType>Component</SubType>
@@ -129,6 +136,10 @@
<SubType>Designer</SubType>
<DependentUpon>AssemblyTest.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Sandbox\EnumWindowsTest.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>EnumWindowsTest.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Sandbox\PhoneButtonManagerTest.resx">
<SubType>Designer</SubType>
<DependentUpon>PhoneButtonManagerTest.cs</DependentUpon>
@@ -157,6 +168,10 @@
<SubType>Designer</SubType>
<DependentUpon>PhoneStateTest.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Sandbox\PingTest.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>PingTest.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Sandbox\SignalStrengthTest.resx">
<SubType>Designer</SubType>
<DependentUpon>SignalStrengthTest.cs</DependentUpon>
@@ -400,6 +415,12 @@
<Compile Include="Sandbox\PhoneStateTest.Designer.cs">
<DependentUpon>PhoneStateTest.cs</DependentUpon>
</Compile>
+ <Compile Include="Sandbox\PingTest.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Sandbox\PingTest.Designer.cs">
+ <DependentUpon>PingTest.cs</DependentUpon>
+ </Compile>
<Compile Include="Sandbox\SignalStrengthTest.cs">
<SubType>Form</SubType>
</Compile>
@@ -650,7 +671,7 @@
<DependentUpon>SystemColorTest.cs</DependentUpon>
</Compile>
<Compile Include="UI\Controls\TabControlTest.cs">
- <SubType>Form</SubType>
+ <SubType>Component</SubType>
</Compile>
<Compile Include="UI\Controls\TabControlTest.Designer.cs">
<DependentUpon>TabControlTest.cs</DependentUpon>
Added: Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.Designer.cs
===================================================================
--- Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.Designer.cs (rev 0)
+++ Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.Designer.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -0,0 +1,105 @@
+namespace Roam.Test.Sandbox
+{
+ partial class EnumWindowsTest
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+ private System.Windows.Forms.MainMenu mainMenu1;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.mainMenu1 = new System.Windows.Forms.MainMenu();
+ this.menuItem1 = new System.Windows.Forms.MenuItem();
+ this.menuItem2 = new System.Windows.Forms.MenuItem();
+ this.menuItem3 = new System.Windows.Forms.MenuItem();
+ this.menuItem4 = new System.Windows.Forms.MenuItem();
+ this._scrollableLabel = new Roam.UI.Controls.ScrollableLabel();
+ this.menuItem5 = new System.Windows.Forms.MenuItem();
+ this.SuspendLayout();
+ //
+ // mainMenu1
+ //
+ this.mainMenu1.MenuItems.Add(this.menuItem1);
+ this.mainMenu1.MenuItems.Add(this.menuItem2);
+ //
+ // menuItem1
+ //
+ this.menuItem1.Text = "Exit";
+ this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
+ //
+ // menuItem2
+ //
+ this.menuItem2.MenuItems.Add(this.menuItem3);
+ this.menuItem2.MenuItems.Add(this.menuItem5);
+ this.menuItem2.MenuItems.Add(this.menuItem4);
+ this.menuItem2.Text = "Menu";
+ //
+ // menuItem3
+ //
+ this.menuItem3.Text = "Enum Windows";
+ this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
+ //
+ // menuItem4
+ //
+ this.menuItem4.Text = "Clear";
+ this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
+ //
+ // _scrollableLabel
+ //
+ this._scrollableLabel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._scrollableLabel.Font = new System.Drawing.Font("Segoe Condensed", 7F, System.Drawing.FontStyle.Regular);
+ this._scrollableLabel.Location = new System.Drawing.Point(0, 0);
+ this._scrollableLabel.Name = "_scrollableLabel";
+ this._scrollableLabel.Size = new System.Drawing.Size(240, 266);
+ this._scrollableLabel.TabIndex = 1;
+ //
+ // menuItem5
+ //
+ this.menuItem5.Text = "Foreground";
+ this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click);
+ //
+ // EnumWindowsTest
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(131F, 131F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+ this.AutoScroll = true;
+ this.ClientSize = new System.Drawing.Size(240, 266);
+ this.Controls.Add(this._scrollableLabel);
+ this.Menu = this.mainMenu1;
+ this.Name = "EnumWindowsTest";
+ this.Text = "EnumWindowsTest";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.MenuItem menuItem1;
+ private Roam.UI.Controls.ScrollableLabel _scrollableLabel;
+ private System.Windows.Forms.MenuItem menuItem2;
+ private System.Windows.Forms.MenuItem menuItem3;
+ private System.Windows.Forms.MenuItem menuItem4;
+ private System.Windows.Forms.MenuItem menuItem5;
+ }
+}
\ No newline at end of file
Added: Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.cs
===================================================================
--- Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.cs (rev 0)
+++ Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -0,0 +1,123 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+using Roam.Common.Utils;
+
+namespace Roam.Test.Sandbox
+{
+ public partial class EnumWindowsTest : Form
+ {
+ EnumWindowsProc callbackDelegate;
+ IntPtr callbackDelegatePointer;
+
+ [DllImport("coredll.dll", SetLastError = true)]
+ public static extern bool EnumWindows(IntPtr lpEnumFunc, uint lParam);
+ public delegate int EnumWindowsProc(IntPtr hwnd, IntPtr lParam);
+
+ public EnumWindowsTest()
+ {
+ InitializeComponent();
+ _scrollableLabel.MaxLines = 200;
+ callbackDelegate = new EnumWindowsProc(EnumWindowsCallbackProc);
+ callbackDelegatePointer = Marshal.GetFunctionPointerForDelegate(callbackDelegate);
+ }
+
+ public int EnumWindowsCallbackProc(IntPtr hwnd, IntPtr lParam)
+ {
+ //System.Diagnostics.Debug.WriteLine("Window: " + hwnd.ToString());
+ //System.Diagnostics.Debug.WriteLine("Window: " + hwnd.ToString());
+ _scrollableLabel.AddLine("hWnd: {0} title: {1}", hwnd, WindowUtils.GetWindowText(hwnd));
+ //StringBuilder sb = new StringBuilder();
+ //_scrollableLabel.AddLine(string.Format("{0} {1}", hwnd.ToString(), WindowUtils.GetWindowText(hwnd, sb, int.MaxValue)));
+ return 1;
+ }
+
+ private void menuItem1_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void menuItem3_Click(object sender, EventArgs e)
+ {
+ EnumWindows(callbackDelegatePointer, 0);
+ }
+
+ private void menuItem4_Click(object sender, EventArgs e)
+ {
+ _scrollableLabel.Clear();
+ }
+
+ private void menuItem5_Click(object sender, EventArgs e)
+ {
+ IntPtr foregroundHwnd = WindowUtils.GetForegroundWindow();
+ _scrollableLabel.AddLine("Foreground: {0} title: {1}", foregroundHwnd, WindowUtils.GetWindowText(foregroundHwnd));
+
+ IntPtr childOfForeground = WindowUtils.GetChildWindow(foregroundHwnd);
+ if (childOfForeground != IntPtr.Zero)
+ {
+ _scrollableLabel.AddLine("Foreground Child: {0} title: {1}", childOfForeground, WindowUtils.GetWindowText(childOfForeground));
+ }
+ }
+ }
+
+ //public partial class EnumWindowsTest : Form
+ //{
+ // /// <summary>
+ // /// The EnumWindowsProc function is an application-defined callback function used with the EnumWindows
+ // /// or EnumDesktopWindows function. It receives top-level window handles. The WNDENUMPROC type defines
+ // /// a pointer to this callback function. EnumWindowsProc is a placeholder for the application-defined
+ // /// function name.
+ // /// </summary>
+ // /// <param name="hwnd">[in] Handle to a top-level window. </param>
+ // /// <param name="lParam">[in] Specifies the application-defined value given in EnumWindows or EnumDesktopWindows. </param>
+ // /// <returns>To continue enumeration, the callback function must return TRUE; to stop enumeration, it must return FALSE. </returns>
+ // public delegate int EnumWindowsProc(IntPtr hwnd, IntPtr lParam);
+
+ // private EnumWindowsProc _callbackDelegate;
+ // private IntPtr _callbackDelegatePointer;
+
+ // [DllImport("coredll.dll", SetLastError = true)]
+ // public static extern int EnumWindows(IntPtr lpEnumFunc, uint lParam);
+
+ // public EnumWindowsTest()
+ // {
+ // InitializeComponent();
+ // _callbackDelegate = new EnumWindowsProc(EnumWindowsCallbackProc);
+ // _callbackDelegatePointer = Marshal.GetFunctionPointerForDelegate(_callbackDelegate);
+ // }
+
+ // private void menuItem1_Click(object sender, EventArgs e)
+ // {
+ // this.Close();
+ // }
+
+ // /// <summary>
+ // ///
+ // /// </summary>
+ // /// <param name="hwnd"></param>
+ // /// <param name="lParam"></param>
+ // /// <returns>To continue enumeration, the callback function must return TRUE; to stop enumeration, it must return FALSE. </returns>
+ // public int EnumWindowsCallbackProc(IntPtr hwnd, IntPtr lParam)
+ // {
+ // System.Diagnostics.Debug.WriteLine("Window: " + hwnd.ToString());
+ // StringBuilder sb = new StringBuilder();
+ // _scrollableLabel.AddLine(string.Format("{0} {1}", hwnd.ToString(), WindowUtils.GetWindowText(hwnd, sb, int.MaxValue)));
+ // return 1;
+ // }
+
+ // private void menuItem3_Click(object sender, EventArgs e)
+ // {
+ // EnumWindows(_callbackDelegatePointer, 0);
+ // }
+
+ // private void menuItem4_Click(object sender, EventArgs e)
+ // {
+ // _scrollableLabel.Clear();
+ // }
+ //}
+}
\ No newline at end of file
Added: Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.resx
===================================================================
--- Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.resx (rev 0)
+++ Trunk/Source/Roam.Test/Sandbox/EnumWindowsTest.resx 2007-07-16 06:41:26 UTC (rev 81)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="$this.FormFactorShadowProperty" xml:space="preserve">
+ <value>Smartphone QVGA</value>
+ </metadata>
+ <metadata name="$this.Skin" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
\ No newline at end of file
Added: Trunk/Source/Roam.Test/Sandbox/PingTest.Designer.cs
===================================================================
--- Trunk/Source/Roam.Test/Sandbox/PingTest.Designer.cs (rev 0)
+++ Trunk/Source/Roam.Test/Sandbox/PingTest.Designer.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -0,0 +1,100 @@
+namespace Roam.Test.Sandbox
+{
+ partial class PingTest
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+ private System.Windows.Forms.MainMenu mainMenu1;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.mainMenu1 = new System.Windows.Forms.MainMenu();
+ this._scrollableLabel = new Roam.UI.Controls.ScrollableLabel();
+ this.menuItem1 = new System.Windows.Forms.MenuItem();
+ this.menuItem2 = new System.Windows.Forms.MenuItem();
+ this._textBoxAddress = new Roam.UI.Controls.TextBox();
+ this.menuItem3 = new System.Windows.Forms.MenuItem();
+ this.SuspendLayout();
+ //
+ // mainMenu1
+ //
+ this.mainMenu1.MenuItems.Add(this.menuItem1);
+ this.mainMenu1.MenuItems.Add(this.menuItem2);
+ //
+ // _scrollableLabel
+ //
+ this._scrollableLabel.Font = new System.Drawing.Font("Segoe Condensed", 7F, System.Drawing.FontStyle.Regular);
+ this._scrollableLabel.Location = new System.Drawing.Point(0, 0);
+ this._scrollableLabel.Name = "_scrollableLabel";
+ this._scrollableLabel.Size = new System.Drawing.Size(240, 231);
+ this._scrollableLabel.TabIndex = 0;
+ //
+ // menuItem1
+ //
+ this.menuItem1.Text = "Exit";
+ this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
+ //
+ // menuItem2
+ //
+ this.menuItem2.MenuItems.Add(this.menuItem3);
+ this.menuItem2.Text = "Menu";
+ //
+ // _textBoxAddress
+ //
+ this._textBoxAddress.Location = new System.Drawing.Point(1, 233);
+ this._textBoxAddress.Name = "_textBoxAddress";
+ this._textBoxAddress.SelectTextOnFocus = true;
+ this._textBoxAddress.Size = new System.Drawing.Size(237, 30);
+ this._textBoxAddress.TabIndex = 1;
+ this._textBoxAddress.Text = "www.yahoo.com";
+ //
+ // menuItem3
+ //
+ this.menuItem3.Text = "Ping";
+ this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
+ //
+ // PingTest
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(131F, 131F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+ this.AutoScroll = true;
+ this.ClientSize = new System.Drawing.Size(240, 266);
+ this.Controls.Add(this._textBoxAddress);
+ this.Controls.Add(this._scrollableLabel);
+ this.Menu = this.mainMenu1;
+ this.Name = "PingTest";
+ this.Text = "PingTest";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Roam.UI.Controls.ScrollableLabel _scrollableLabel;
+ private System.Windows.Forms.MenuItem menuItem1;
+ private System.Windows.Forms.MenuItem menuItem2;
+ private System.Windows.Forms.MenuItem menuItem3;
+ private Roam.UI.Controls.TextBox _textBoxAddress;
+ }
+}
\ No newline at end of file
Added: Trunk/Source/Roam.Test/Sandbox/PingTest.cs
===================================================================
--- Trunk/Source/Roam.Test/Sandbox/PingTest.cs (rev 0)
+++ Trunk/Source/Roam.Test/Sandbox/PingTest.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using OpenNETCF.Net.NetworkInformation;
+
+namespace Roam.Test.Sandbox
+{
+ public partial class PingTest : Form
+ {
+ public PingTest()
+ {
+ InitializeComponent();
+ }
+
+ private void menuItem3_Click(object sender, EventArgs e)
+ {
+ Ping ping = new Ping();
+ //PingOptions pingOptions = new PingOptions()
+
+ _scrollableLabel.AddLine("Pinging " + _textBoxAddress.Text + " ...");
+ Application.DoEvents();
+ Cursor.Current = Cursors.WaitCursor;
+ PingReply pingReply = ping.Send(_textBoxAddress.Text, 40000);
+ Cursor.Current = Cursors.Default;
+ _scrollableLabel.AddLine(string.Format("Reply from {0}: bytes={1} time={2}ms TTL={3}",
+ pingReply.Address, pingReply.Buffer.Length, pingReply.RoundTripTime, pingReply.Options.Ttl));
+ ping.Dispose();
+ }
+
+ private void menuItem1_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+ }
+}
\ No newline at end of file
Added: Trunk/Source/Roam.Test/Sandbox/PingTest.resx
===================================================================
--- Trunk/Source/Roam.Test/Sandbox/PingTest.resx (rev 0)
+++ Trunk/Source/Roam.Test/Sandbox/PingTest.resx 2007-07-16 06:41:26 UTC (rev 81)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="$this.FormFactorShadowProperty" xml:space="preserve">
+ <value>Smartphone QVGA</value>
+ </metadata>
+ <metadata name="$this.Skin" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
\ No newline at end of file
Modified: Trunk/Source/Roam.Test/Utils/KeySnifferTest.Designer.cs
===================================================================
--- Trunk/Source/Roam.Test/Utils/KeySnifferTest.Designer.cs 2007-07-01 22:43:14 UTC (rev 80)
+++ Trunk/Source/Roam.Test/Utils/KeySnifferTest.Designer.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -34,6 +34,7 @@
this.menuItem2 = new System.Windows.Forms.MenuItem();
this._menuItemStartStop = new System.Windows.Forms.MenuItem();
this._scrollableLabel = new Roam.UI.Controls.ScrollableLabel();
+ this._menuItemTrap = new System.Windows.Forms.MenuItem();
this.SuspendLayout();
//
// mainMenu1
@@ -49,6 +50,7 @@
// menuItem2
//
this.menuItem2.MenuItems.Add(this._menuItemStartStop);
+ this.menuItem2.MenuItems.Add(this._menuItemTrap);
this.menuItem2.Text = "Menu";
//
// _menuItemStartStop
@@ -65,6 +67,10 @@
this._scrollableLabel.Size = new System.Drawing.Size(240, 266);
this._scrollableLabel.TabIndex = 3;
//
+ // _menuItemTrap
+ //
+ this._menuItemTrap.Text = "Trap";
+ //
// KeySnifferTest
//
this.AutoScaleDimensions = new System.Drawing.SizeF(131F, 131F);
@@ -85,5 +91,6 @@
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem _menuItemStartStop;
private Roam.UI.Controls.ScrollableLabel _scrollableLabel;
+ private System.Windows.Forms.MenuItem _menuItemTrap;
}
}
\ No newline at end of file
Modified: Trunk/Source/Roam.Test/Utils/KeySnifferTest.cs
===================================================================
--- Trunk/Source/Roam.Test/Utils/KeySnifferTest.cs 2007-07-01 22:43:14 UTC (rev 80)
+++ Trunk/Source/Roam.Test/Utils/KeySnifferTest.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -37,12 +37,20 @@
private void _keySniffer_KeyUp(object sender, KeyEventArgs e)
{
- PrintKey("KEYUP", e);
+ PrintKey("KEYUP", e);
+ if (_menuItemTrap.Checked)
+ {
+ e.Handled = true;
+ }
}
private void _keySniffer_KeyDown(object sender, KeyEventArgs e)
{
- PrintKey("KEYDOWN", e);
+ PrintKey("KEYDOWN", e);
+ if (_menuItemTrap.Checked)
+ {
+ e.Handled = true;
+ }
}
private void PrintKey(string p, KeyEventArgs e)
@@ -69,5 +77,10 @@
_keySniffer.Start();
}
}
+
+ private void _menuItemTrap_Click(object sender, EventArgs e)
+ {
+ _menuItemTrap.Checked = !_menuItemTrap.Checked;
+ }
}
}
\ No newline at end of file
Modified: Trunk/Source/Roam.UI/Controls/ScrollableLabel.cs
===================================================================
--- Trunk/Source/Roam.UI/Controls/ScrollableLabel.cs 2007-07-01 22:43:14 UTC (rev 80)
+++ Trunk/Source/Roam.UI/Controls/ScrollableLabel.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -58,12 +58,21 @@
private Fill _backFill = new FillSimpleLinearGradient(new SimpleLinearGradient(Color.FromArgb(206, 223, 239), Color.White, SimpleLinearGradient.FillDirection.TopToBottom));
private Insets _textInsets = new Insets(1, 1, 1, 1);
#endregion Private Fields
-
public ScrollableLabel()
: this(String.Empty)
{
}
+ /// <summary>
+ /// Default is 30 lines
+ /// </summary>
+ /// <param name="maxLines"></param>
+ public ScrollableLabel(int maxLines)
+ : this(string.Empty)
+ {
+ _buffer.MaxItems = maxLines;
+ }
+
public ScrollableLabel(string text)
{
_vScrollBar = new VScrollBar();
Modified: Trunk/Source/Roam.UI/Utils/KeySniffer.cs
===================================================================
--- Trunk/Source/Roam.UI/Utils/KeySniffer.cs 2007-07-01 22:43:14 UTC (rev 80)
+++ Trunk/Source/Roam.UI/Utils/KeySniffer.cs 2007-07-16 06:41:26 UTC (rev 81)
@@ -19,6 +19,7 @@
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Roam.Utils;
+using System.Reflection;
namespace Roam.UI.Utils
{
@@ -49,6 +50,7 @@
protected delegate int HookProc(int code, IntPtr wParam, IntPtr lParam);
+ #region Constructors
public KeySniffer()
{
}
@@ -57,10 +59,14 @@
{
if (startImmediately) { Start(); }
}
+ #endregion Constructors
+ #region Properties
public bool IsSniffing { get { return _hookHandle != 0; } }
+ #endregion Properties
- public virtual bool Start()
+ #region Methods
+ public bool Start()
{
if (IsSniffing)
{
@@ -80,7 +86,7 @@
return _hookHandle != 0;
}
- public virtual bool Stop()
+ public bool Stop()
{
if (_hookHandle != 0)
{
@@ -115,9 +121,9 @@
{
KBDLLHOOKSTRUCT hookStruct = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT));
Keys key = (Keys)hookStruct.VkCode;
- Debug.WriteLine(string.Format("wParam: {5} lParam: {6} key: {0} flags: {1} scancode: {2} time: {3} extrainfo: {4}",
- key, hookStruct.Flags, hookStruct.ScanCode, hookStruct.Time, hookStruct.ExtraInfo,
- wParam, lParam));
+ //Debug.WriteLine(string.Format("wParam: {5} lParam: {6} key: {0} flags: {1} scancode: {2} time: {3} extrainfo: {4}",
+ // key, hookStruct.Flags, hookStruct.ScanCode, hookStruct.Time, hookStruct.ExtraInfo,
+ // wParam, lParam));
//if any of the underlying events set the e.Handled flag
bool handled = false;
@@ -148,8 +154,9 @@
if (handled)
{ return 1;}
else
- { return CallNextHookEx(_hookDelegate,code, wParam, lParam);}
+ { return CallNextHookEx(_hookDelegate,code, wParam, lParam);}
}
+ #endregion Methods
#region P/Invoke Declarations
/// <summary>
Modified: Trunk/Source/Roam.suo
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|