Fire the CTRL-F9 button everywhere in windows 10. lazarus / 34-Windows ---------------------------------------------------------------------- pascalbythree · 2023-03-09 17:47 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState  );begin   if (Shift = [ssCtrl]) AND (Key = 120) then memo1.Lines.Append('Ctrl F9');end; Like this it got to work to receive the CTRL-F9 key when pressed on the form. Does anybody know what to change to fire the code from the CTRL-F9 key, everywhere in windows 10 ? Even though the form is not focused ? Greets, Wouter van Wegen ---------------------------------------------------------------------- Bart · 2023-03-09 17:49 Especially Lazarus users are going to thank you for "stealing" Ctrl+F9  Bart ---------------------------------------------------------------------- pascalbythree · 2023-03-09 18:02 CTRL-F10 will also do. Just as it responds everywhere in windows when application not focused. ---------------------------------------------------------------------- Martin_fr · 2023-03-09 18:31 google: msdn global key hook ---------------------------------------------------------------------- marcov · 2023-03-09 18:36 In Delphi this is done via applicationevents.shortcut Code: [Select]procedure TRootMain.ApplicationEvents1ShortCut(var Msg: TWMKey;   var Handled: Boolean); var  RawMessage: TMessage;  fkey,shift : integer; begin  if not assigned(basehandling) or not allowkeys then     exit;  // Kijk in de raw message welke message er gestuurd is. {  if Msg.Msg = WM_KEYDOWN then  begin}    // Debug: Log de tijd in een memo op het main form om te zien of het werkt.    // Memo1.Lines.Insert(0, DateTimeToStr(Now));    // Gebruik een 'normale' TMessage omdat dat makkelijker is.    RawMessage:= TMessage(Msg);    // Die is namelijk eventueel te typecasten naar een speciaal daarvoor    // gemaakt record. Je kunt natuurlijk ook rechtstreeks de WParam en LParam    // van Msg gaan ontleden, maar dit is makkelijker.    if (msg.CharCode >=VK_F1) and (msg.CharCode <=VK_F12) and not BaseHandling.canclose  then      begin        fkey:=msg.charcode-vk_f1;        shift:=0;        if HiByte(GetKeyState(VK_SHIFT))>0 then inc(shift,1);        if (HiByte(GetKeyState(VK_MENU))>0) then inc(shift,2);        if (HiByte(GetKeyState(VK_CONTROL))>0) then inc(shift,4);        basehandling.keyevent(fkey,shift);          //handled:=true;      end end; ---------------------------------------------------------------------- paweld · 2023-03-10 06:54 I use something like the one in the attachment ---------------------------------------------------------------------- pascalbythree · 2023-03-11 09:13 Thank you everybody, it got to work!