diff --git a/Source/NotifyIconWpf/Interop/WinApi.cs b/Source/NotifyIconWpf/Interop/WinApi.cs index e0d61ba..2cb96ea 100644 --- a/Source/NotifyIconWpf/Interop/WinApi.cs +++ b/Source/NotifyIconWpf/Interop/WinApi.cs @@ -21,15 +21,15 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop [DllImport("USER32.DLL", EntryPoint = "CreateWindowExW", SetLastError = true)] public static extern IntPtr CreateWindowEx(int dwExStyle, [MarshalAs(UnmanagedType.LPWStr)] string lpClassName, [MarshalAs(UnmanagedType.LPWStr)] string lpWindowName, int dwStyle, int x, int y, - int nWidth, int nHeight, uint hWndParent, int hMenu, int hInstance, - int lpParam); + int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, + IntPtr lpParam); /// /// Processes a default windows procedure. /// [DllImport("USER32.DLL")] - public static extern long DefWindowProc(IntPtr hWnd, uint msg, uint wparam, uint lparam); + public static extern IntPtr DefWindowProc(IntPtr hWnd, uint msg, IntPtr wparam, IntPtr lparam); /// /// Registers the helper window class. diff --git a/Source/NotifyIconWpf/Interop/WindowClass.cs b/Source/NotifyIconWpf/Interop/WindowClass.cs index e4f625a..bfc42f7 100644 --- a/Source/NotifyIconWpf/Interop/WindowClass.cs +++ b/Source/NotifyIconWpf/Interop/WindowClass.cs @@ -7,7 +7,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop /// Callback delegate which is used by the Windows API to /// submit window messages. /// - public delegate long WindowProcedureHandler(IntPtr hwnd, uint uMsg, uint wparam, uint lparam); + public delegate IntPtr WindowProcedureHandler(IntPtr hwnd, uint uMsg, IntPtr wparam, IntPtr lparam); /// diff --git a/Source/NotifyIconWpf/Interop/WindowMessageSink.cs b/Source/NotifyIconWpf/Interop/WindowMessageSink.cs index 3c696f9..42fd3a9 100644 --- a/Source/NotifyIconWpf/Interop/WindowMessageSink.cs +++ b/Source/NotifyIconWpf/Interop/WindowMessageSink.cs @@ -187,14 +187,14 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop taskbarRestartMessageId = WinApi.RegisterWindowMessage("TaskbarCreated"); // Create the message window - MessageWindowHandle = WinApi.CreateWindowEx(0, WindowId, "", 0, 0, 0, 1, 1, 0, 0, 0, 0); + MessageWindowHandle = WinApi.CreateWindowEx(0, WindowId, "", 0, 0, 0, 1, 1, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); if (MessageWindowHandle == IntPtr.Zero) { #if SILVERLIGHT throw new Exception("Message window handle was not a valid pointer."); #else - throw new Win32Exception(); + throw new Win32Exception("Message window handle was not a valid pointer"); #endif } } @@ -207,7 +207,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop /// /// Callback method that receives messages from the taskbar area. /// - private long OnWindowMessageReceived(IntPtr hwnd, uint messageId, uint wparam, uint lparam) + private IntPtr OnWindowMessageReceived(IntPtr hwnd, uint messageId, IntPtr wparam, IntPtr lparam) { if (messageId == taskbarRestartMessageId) { @@ -231,15 +231,14 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop /// or higher, this parameter can be used to resolve mouse coordinates. /// Currently not in use. /// Provides information about the event. - private void ProcessWindowMessage(uint msg, uint wParam, uint lParam) + private void ProcessWindowMessage(uint msg, IntPtr wParam, IntPtr lParam) { if (msg != CallbackMessageId) return; - switch (lParam) + switch (lParam.ToInt32()) { case 0x200: - MouseEventReceived(MouseEvent.MouseMove); - break; + MouseEventReceived(MouseEvent.MouseMove); break; case 0x201: MouseEventReceived(MouseEvent.IconLeftMouseDown);