AFAIK there is no "simple" way to do this, but it is possible.
Method 1- Windows Message Queue
Complicated and more difficult to maintain/understand, but this has the advantage of "being in one place". Here is a reference
MSDN Windows Message and Message Queues[
^]
- Hook into the windows queue from the main form
- Catch all Function key presses for the current application from the queue (don't forget to handle!)
Method 2- Custom Window Class
Simpler, but but code spread around.
- Sublcass a form and add an event that fires when a function key is pressed (passing the key number
- In the subclassed form hook up the function keys so they call the event in the above step
- In the subclass, automatically subscribe into created child form's Function key event, and re-raise if child form fires
- Derive all forms from the subclass
- In the main [root] form, subscribe into the top function key event and put the desired functionality into the handling method
Hopefully, someone else might have worked out a better solution, in WPF what you ask for would be a doddle.