NotifyWPF

---------
CHG   Lot of plumbing, some fixes
CHG   Work on sample project.
CHG   Popups and ContextMenu now store coordinates - otherwise delayed opending may happen elsewhere.

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@55 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
Philipp Sumi
2009-03-31 22:20:07 +00:00
parent 229042b075
commit 354ba1ca43
26 changed files with 1379 additions and 308 deletions

View File

@@ -0,0 +1,14 @@
using System.Runtime.InteropServices;
namespace Hardcodet.Wpf.TaskbarNotification.Interop
{
/// <summary>
/// Win API struct providing coordinates for a single point.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Point
{
public int X;
public int Y;
}
}

View File

@@ -74,7 +74,14 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// consider the mouse action a double-click.</returns>
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern int GetDoubleClickTime();
/// <summary>
/// Gets the screen coordinates of the current mouse position.
/// </summary>
/// <param name="lpPoint"></param>
/// <returns></returns>
[DllImport("USER32.DLL", SetLastError = true)]
public static extern bool GetCursorPos(ref Point lpPoint);
}
}

View File

@@ -8,7 +8,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// Receives messages from the taskbar icon through
/// window messages of an underlying helper window.
/// </summary>
public partial class WindowMessageSink : IDisposable
public class WindowMessageSink : IDisposable
{
#region members
@@ -196,10 +196,11 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// <summary>
/// Processes incoming system messages.
/// </summary>
/// <param name="msg"></param>
/// <param name="wParam"></param>
/// <param name="lParam"></param>
/// <returns></returns>
/// <param name="msg">Callback ID.</param>
/// <param name="wParam">If the version is <see cref="NotifyIconVersion.Vista"/>
/// or higher, this parameter can be used to resolve mouse coordinates.
/// Currently not in use.</param>
/// <param name="lParam">Provides information about the event.</param>
private void ProcessWindowMessage(uint msg, uint wParam, uint lParam)
{
if (msg != CallbackMessageId) return;