Показать сообщение отдельно
  #5  
Старый 13.04.2015, 10:53
Аватар для NumLock
NumLock NumLock вне форума
Let Me Show You
 
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
По умолчанию

Код:
procedure ShortCutToModifiersKey(ShortCut: TShortCut;
  var Modifiers: Cardinal; var Key: Cardinal);
begin
  Key := ShortCut and not (scShift + scCtrl + scAlt);
  Modifiers := 0;
  if ShortCut and scShift <> 0 then Modifiers := Modifiers or MOD_SHIFT;
  if ShortCut and scCtrl <> 0 then Modifiers := Modifiers or MOD_CONTROL;
  if ShortCut and scAlt <> 0 then Modifiers := Modifiers or MOD_ALT;
end;

Код:
var
  Modifiers: Cardinal;
  Key: Cardinal;
begin
  ShortCutToModifiersKey(HotKey1.HotKey, Modifiers, Key);
  RegisterHotKey(Handle, 1, Modifiers, Key);
end;
__________________
Пишу программы за еду.
__________________
Ответить с цитированием