Dokładnie, jest przygotowywana kolejka zadań do wykonania z parametrami do działania (np. właśnie współrzędne w które użytkownik chce kliknąć) :)
Tylko pojawił się kolejny problem, który nie bardzo rozumiem. Przygotowałam sobie skróty klawiszowe do zadań od F1 do F12. Wszystkie działają... poza F12. I nie wiem dlaczego F12 nie działa. Oto kod:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11, id12: Integer;
procedure WMHotKey(var Msg: TWMHotKey); message WM_HOTKEY;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
// HotKey F1
id1 := GlobalAddAtom('HotKey1');
RegisterHotKey(Handle, id1, 0{MOD_CONTROL}, VK_F1);
// HotKey F2
id2 := GlobalAddAtom('HotKey2');
RegisterHotKey(Handle, id2, 0{MOD_ALT + MOD_SHIFT}, VK_F2{VK_A});
// HotKey F3
id3 := GlobalAddAtom('HotKey3');
RegisterHotKey(Handle, id3, 0{MOD_WIN}, VK_F3{VK_A});
// HotKey F4
id4 := GlobalAddAtom('HotKey4');
RegisterHotKey(Handle, id4, 0, VK_F4{VK_SNAPSHOT});
// HotKey F5
id5 := GlobalAddAtom('HotKey5');
RegisterHotKey(Handle, id5, 0{MOD_CONTROL}, VK_F5);
// HotKey F6
id6 := GlobalAddAtom('HotKey6');
RegisterHotKey(Handle, id6, 0{MOD_CONTROL}, VK_F6);
// HotKey F7
id7 := GlobalAddAtom('HotKey7');
RegisterHotKey(Handle, id7, 0{MOD_CONTROL}, VK_F7);
// HotKey F8
id8 := GlobalAddAtom('HotKey8');
RegisterHotKey(Handle, id8, 0{MOD_CONTROL}, VK_F8);
// HotKey F9
id9 := GlobalAddAtom('HotKey9');
RegisterHotKey(Handle, id9, 0{MOD_CONTROL}, VK_F9);
// HotKey F10
id10 := GlobalAddAtom('HotKey10');
RegisterHotKey(Handle, id10, 0{MOD_CONTROL}, VK_F10);
// HotKey F11
id11 := GlobalAddAtom('HotKey11');
RegisterHotKey(Handle, id11, 0{MOD_CONTROL}, VK_F11);
// HotKey F12
id12 := GlobalAddAtom('HotKey12');
RegisterHotKey(Handle, id12, 0{MOD_CONTROL}, VK_F12);
end;
//--------------- HOT KEYE ---------------------
procedure TForm1.WMHotKey(var Msg: TWMHotKey);
var
MausPos: TPoint;
begin
if Msg.HotKey = id1 then
begin
ShowMessage('F1');
end;
if Msg.HotKey = id2 then
begin
ShowMessage('F2');
end;
if Msg.HotKey = id3 then
begin
ShowMessage('F3');
end;
if Msg.HotKey = id4 then
begin
ShowMessage('F4');
end;
if Msg.HotKey = id5 then
begin
ShowMessage('F5');
end;
if Msg.HotKey = id6 then
begin
ShowMessage('F6');
end;
if Msg.HotKey = id7 then
begin
ShowMessage('F7');
end;
if Msg.HotKey = id8 then
begin
ShowMessage('F8');
end;
if Msg.HotKey = id9 then
begin
ShowMessage('F9');
end;
if Msg.HotKey = id10 then
begin
ShowMessage('F10');
end;
if Msg.HotKey = id11 then
begin
ShowMessage('F11');
end;
if Msg.HotKey = id12 then
begin
ShowMessage('F12');
end;
end;
//----------------------------------
end.
Czy ktoś z Was widzi dlaczego klawisz F12 nie działa?