Detecting a key press

Hi, What is the best way of detecting that the user has pressed certain key (F8 in my case)? I saw a suggestion in another thread, involving a hidden menu button with shortcut key F8; the only problem is that the usual F8 functionality of Navision no longer works then. Is there a better way? Thanks, Alastair

Well, putting F8 on the menu item is not a great idea, because as you said it will break the standard Navision Functionality. Probably some can write a custom control (OCX) to detect the F8 key for you. :slight_smile:

If you write an OCX (or better activex dll) you can use the RegisterHotkey API function to set a global hotkey for the F8 key (or any other key combination). But you must register this hotkey with a window (hwnd) so you should create a dummy invisible window to receive WM_HOTKEY events. Plus if you use visual basic you must create a hook for this window to be able to receive the WM_HOTKEY event. All together rather difficult …