Fixed stackoverflow...
This commit is contained in:
@@ -72,11 +72,17 @@ namespace NotificationFlyout.Wpf.UI.Helpers
|
||||
return state;
|
||||
}
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
private static extern IntPtr DefWindowProcW(IntPtr handle, uint msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
private static IntPtr GetSystemTrayHandle()
|
||||
{
|
||||
return WindowHelper.GetHandle(ShellTrayHandleName);
|
||||
}
|
||||
|
||||
[DllImport("shell32.dll", SetLastError = true)]
|
||||
private static extern IntPtr SHAppBarMessage(AppBarMessage dwMessage, ref AppBarData pData);
|
||||
|
||||
private AppBarData GetAppBarData(IntPtr handle)
|
||||
{
|
||||
return new AppBarData
|
||||
@@ -86,20 +92,6 @@ namespace NotificationFlyout.Wpf.UI.Helpers
|
||||
};
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct AppBarData
|
||||
{
|
||||
public uint cbSize;
|
||||
public IntPtr hWnd;
|
||||
public uint uCallbackMessage;
|
||||
public AppBarEdge uEdge;
|
||||
public RECT rect;
|
||||
public int lParam;
|
||||
}
|
||||
|
||||
[DllImport("shell32.dll", SetLastError = true)]
|
||||
private static extern IntPtr SHAppBarMessage(AppBarMessage dwMessage, ref AppBarData pData);
|
||||
|
||||
private void GetAppBarPosition(ref AppBarData appBarData)
|
||||
{
|
||||
SHAppBarMessage(AppBarMessage.GetTaskbarPos, ref appBarData);
|
||||
@@ -112,7 +104,18 @@ namespace NotificationFlyout.Wpf.UI.Helpers
|
||||
TaskbarChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
return (IntPtr)(int)PInvoke.DefWindowProc((HWND)hwnd, (uint)msg, (WPARAM)(UIntPtr)(uint)wParam, (LPARAM)lParam);
|
||||
return DefWindowProcW(hwnd, (uint)msg, wParam, (lParam));
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct AppBarData
|
||||
{
|
||||
public uint cbSize;
|
||||
public IntPtr hWnd;
|
||||
public uint uCallbackMessage;
|
||||
public AppBarEdge uEdge;
|
||||
public RECT rect;
|
||||
public int lParam;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user