From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function RegisterShortCut(ShortCut: TShortCut; Index: integer = -1): integer;


extern DELPHI_PACKAGE int __fastcall RegisterShortCut(System::Classes::TShortCut ShortCut, int Index = 0xffffffff);


Type Visibility Source Unit Parent
function public
System.Actions System.Actions


Registers the specified <ShortCut>, with the specified <Index> if it is a valid index, and returns the registered index.

The specified <Index> is ignored if:

  • It is not a valid index. Only positive integers are valid: 0, 1, 2…
  • It is higher than the number of registered shortcuts.

When the specified <Index> is ignored, your shortcut is registered with an index that is equal to the number of registered shortcuts. For example, if there are three shortcuts registered (with indexes 0, 1 and 2), and you try to register a new shortcut with index 6, since 6 is higher than the number of registered shortcuts (3), your new shortcut is registered with index 3 instead of index 6.

After you register an instance of TShortCut, you can call RegisteredShortCut with the registered <Index> to retrieve that shortcut.

You can use UnregisterShortCut to unregister a previously-registered shortcut.

See Also