Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.12.26;
Скачать: CL | DM;

Вниз

Hot key?   Найти похожие ветки 

 
Wolffgang   (2004-12-09 18:39) [0]

Здрасте.

Надо сделать, чтобы прога, будучи свернутой в трей, при нажатии например Ctrl+Alt+Y разворачивалась.

Не подскажете, где копать?


 
grom   (2004-12-09 19:40) [1]

procedure HotKey(var M:TMessage);message WM_HOTKEY;
........
procedure TForm1.HotKey(var M: TMessage);
begin if M.WParam=1then CheckBox3.Checked:=true;
     if M.WParam=2then CheckBox4.Checked:=true;
end;

procedure TForm1.BitBtn2Click(Sender: TObject);
var Modifiers: Cardinal;
begin
  BitBtn2.Enabled:=False;
  HotKey1.Enabled:=False;
  HotKey2.Enabled:=False;
    Modifiers:=0;
    UnregisterHotKey(Handle,1);
    if HotKey1.HotKey<>0 then begin
    if HotKey1.HotKey and scAlt<>0 then Modifiers:=Modifiers+MOD_ALT;
    if HotKey1.HotKey and scCtrl<>0 then Modifiers:=Modifiers+MOD_CONTROL;
    if HotKey1.HotKey and scShift<>0 then Modifiers:=Modifiers+MOD_SHIFT;
    RegisterHotKey(Handle,1,Modifiers,hotKey1.HotKey and not(scShift+scCtrl+scAlt));
end;
    Modifiers:=0;
    UnregisterHotKey(Handle,2);
    if HotKey2.HotKey<>0 then begin
    if HotKey2.HotKey and scAlt<>0 then Modifiers:=Modifiers+MOD_ALT;
    if HotKey2.HotKey and scCtrl<>0 then Modifiers:=Modifiers+MOD_CONTROL;
    if HotKey2.HotKey and scShift<>0 then Modifiers:=Modifiers+MOD_SHIFT;
    RegisterHotKey(Handle,2,Modifiers,hotKey2.HotKey and not(scShift+scCtrl+scAlt));
end;

end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
 BitBtn2.Enabled:=True;
 HotKey1.Enabled:=True;
 HotKey2.Enabled:=True;
 UnregisterHotKey(Handle,1);
 UnregisterHotKey(Handle,2);
end;
может разберёшся


 
chelovek   (2004-12-09 19:57) [2]

http://delphimaster.net/view/1-1102410684/
Довольно развернуто и дохотчиво.



Страницы: 1 вся ветка

Текущий архив: 2004.12.26;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.041 c
1-1102933987
Bobby Digital
2004-12-13 13:33
2004.12.26
Float &amp; Int


3-1101227478
AUS_r4nd0m
2004-11-23 19:31
2004.12.26
Перестройка индексов при добавлении в InterBase c помощью ХП


1-1102501731
Sirus
2004-12-08 13:28
2004.12.26
Как вставить байты в файл и как их оттуда удалить???


4-1100151730
Delph
2004-11-11 08:42
2004.12.26
Блокировка щелчка мышью в заголовке окна (формы)


6-1097594243
PiOnEr
2004-10-12 19:17
2004.12.26
Mozilla &amp; Delphi