procedure TForm1.Button1Click(Sender: TObject);
begin
Handle := FindWindow('
D3D Window', '
....');
Listbox1.Items.Clear;
EnumWindows(@EnumWinProc, DWord(Listbox));
If Listbox1.Items.Text = '
'
Then
Button1.Enabled := True
Else begin
Edit1.Enabled := True;
Combobox1.Enabled := True;
Button1.Enabled := False;
Button2.Enabled := True;
end;
end;
procedure TForm1.Bot1StopClick(Sender: TObject);
begin
Button1.Enabled := True;
Listbox1.Clear;
Button2.Enabled := False;
Edit1.Enabled := False;;
Combobox1.Enabled := False;
Timer1.Enabled := False;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
dwKey : DWord;
begin
if (Combobox1.ItemIndex <> -1)
then
begin
dwKey := VK_F1 + Combobox1.ItemIndex;
myPostMessageA(Handle1, WM_KEYDOWN, dwKey, MapVirtualKey(dwKey, 0));
end;
end;