I have assembly that targets .NET 2.0 to be compatible with a broad range of applications. When used with a desktop application (either winforms or WPF) I want to hook certain hotkeys and popup modeless dialog windows. The tricky bit is finding a solution that can be implemented under .NET 2.0 that is compatible with WPF.
For winforms I could use RegisterHotKey or implement IMessageFilter and hook WM_KEYDOWN in the PreFilterMessage method, but they don't work well with WPF.
For WPF, the InputBinding class is very nice, but this isn't available in .NET 2.0.
An ideal solution would:
Build in an assembly targeting .NET
Hook keystrokes for either WPF or Winforms
Provide application-wide, not system-wide scope