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

Вниз

RegisterHotKey (KOL)   Найти похожие ветки 

 
feens   (2005-07-28 00:03) [0]

Пробовал все варианты что нашел здесь и в FAQ но все равно программа не работает как надо - нечего не делает когда нажимаю "Q".

function appmsg(var Dummy_Self: PObj; var Msg: tagMSG;var Rslt:Integer):boolean;
begin
 result:=false;
 if (msg.message=WM_HOTKEY) and (msg.wParam=ord("q")) then begin
   h:=findwindow(nil,"windov");
   if h<>0 then sendmessage(h,WM_CLOSE,0,0);
   result:=true;
 end;
end;

begin
...
RegisterHotkey(applet.Handle, ord("q"), 0, ord("q") );
Applet.OnMessage := TOnMessage(MakeMethod( nil, @appmsg));
...
end.

Что здесь неправильно?

Программа только сидит в tray и ждет hotkey, потому handle у всех обьектах (TrayIcon, PopupMenu) есть applet. MCK не использую.


 
Thaddy   (2005-07-28 01:01) [1]

Hotkeys need to be combined with either alt or crtl, unless you install a true keyboardhook or do something similar as I did with my pianokeyboard control, i.e. intercept everything and translate it into another keycode.


 
Dodfr   (2005-07-28 02:01) [2]

also with shift :-) and you can even mix them alll to make some complicated CTRL+SHIFT+ALT+A

Also your registerhotkey parameters is bad !

unique_id:=GlobalAddATOM("MyHotKey"); // idea to get some unique id

RegisterHotKey(form.Handle, unique_id, MOD_CONTROL + MOD_ALT + MOD_SHIFT, VK_A);

You can pass handle of form instead of applet.


 
Thaddy   (2005-07-28 12:18) [3]

2dodfr: but only shift+ q won&#39;t work! that is simply uppercase. Alt or ctrl (or windows key) are necessary for the proper working of a hot key.



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

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

Наверх




Память: 0.47 MB
Время: 0.083 c
3-1138617950
AMD Andron64
2006-01-30 13:45
2006.03.19
Установка FireBird с программой


3-1138095220
dtm
2006-01-24 12:33
2006.03.19
Кодировка поля таблицы типа "text" - can not transliterate


15-1140619727
ArtemESC
2006-02-22 17:48
2006.03.19
ScanCode => Ascii


1-1139752949
Pit
2006-02-12 17:02
2006.03.19
Hint ы в Popupmenu


15-1140874598
Вадюкан
2006-02-25 16:36
2006.03.19
Помогите решить задачу!