I'm doing some work on an app where the user can click a button or press a function key to achieve the same thing (the user wanted a keyboard interface).

This works by putting 'if keycode = vbkeyF1 then' type statements in the form_keydown event and was working fine.

However, now I've assigned a function to F4 you can no longer use ALT-F4 to close the program as it just triggers the F4 event and doesn't decode the ALT, which will annoy users used to common key combinations.

Since there is no 'vbKeyAlt', is there any way of differentiating between F4 and ALT-F4?