mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-02-10 02:02:36 -05:00
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:
14
Source/NotifyIconWpf/Interop/Point.cs
Normal file
14
Source/NotifyIconWpf/Interop/Point.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user