Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.024 c
8-1096036237
4МО
2004-09-24 18:30
2004.12.26
Как выдрать title из jpeg a?


14-1102606894
Alekc
2004-12-09 18:41
2004.12.26
Описание .net


1-1102688504
klyg
2004-12-10 17:21
2004.12.26
Поясните значение параметров процедуры


14-1102215968
Думкин
2004-12-05 06:06
2004.12.26
С днем рождения! 5 декабря


3-1101458305
ocean
2004-11-26 11:38
2004.12.26
Репликация MS SQL




   Наверх