Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6716031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:41:04+00:00 2026-05-26T08:41:04+00:00

I need to hide a form to the system tray, but in the same

  • 0

I need to hide a form to the system tray, but in the same time I want to use hotkey, such a “ctrl+3” to get text from tEdit on my hiden form being inserted to Firefox SendText(edit1.Text); // in such method’. I know how to insert text, but i don’t know anything about hotkeys/ Any suggestions? Thank you. Code of text inserting below

procedure SendText(const Value: WideString);
var
  I: Integer;
  S: WideString;
  TI: TInput;
  KI: TKeybdInput;
const
  KEYEVENTF_UNICODE = $0004;
begin
  S := WideUpperCase(Value); 
  TI.Itype := INPUT_KEYBOARD;
  for I := 1 to Length(S) do
  begin
    KI.wVk := 0;
    KI.dwFlags := KEYEVENTF_UNICODE;
    KI.wScan := Ord(S[I]);
    TI.ki := KI;
    SendInput(1, TI, SizeOf(TI));
  end;
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:41:04+00:00Added an answer on May 26, 2026 at 8:41 am

    To Register a system wide hotkey you must use the RegisterHotKey and UnRegisterHotKey functions.

    Check this sample

    type
      TForm125 = class(TForm)
        procedure FormCreate(Sender: TObject);
        procedure FormDestroy(Sender: TObject);
      private
        HotKey1 : Integer;
        procedure WMHotKey(var Msg: TWMHotKey); message WM_HOTKEY;
      public
    
      end;
    
    var
      Form125: TForm125;
    
    implementation
    
    {$R *.dfm}
    
    
    procedure TForm125.FormCreate(Sender: TObject);
    begin
      HotKey1 := GlobalAddAtom('MyAppHotkey1');//create a unique value for identify the hotkey
      if not RegisterHotKey(Handle, HotKey1, MOD_CONTROL, VK_F1) then //register the hotkey CTRL + F1
       ShowMessage('Sorry can not register the hotkey');
    end;
    
    procedure TForm125.FormDestroy(Sender: TObject);
    begin
      UnRegisterHotKey(Handle, HotKey1);//unregister the hotkey
      GlobalDeleteAtom(HotKey1);//remove the atom
    end;
    
    procedure TForm125.WMHotKey(var Msg: TWMHotKey);
    begin
      if Msg.HotKey = HotKey1 then
        ShowMessage('Hello'); // do your stuff
    end;
    

    Just be carefull about the key combination which you choose, because can be used internally for another app. for example the combination Ctrl Number is used by Firefox to switch the tabs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to hide a Windows form from the taskbar but I can't use
i need to hide a windows program (not visible in taskbar, system tray. visible
Possible Duplicate: how to hide a div after some time period? i need to
I have a JavaScript where I need to hide (and eventually show) some text
I have an form, and I need to hide on a certain action hide
I got a newletter php form, so what I need is to hide the
I need to hide some text (Add £0.20) which is within a td. I
I need to hide phone numbers and other contact details in user generated content
Im developing a touchscreen app and I need to hide the cursor whenever it
I am creating a custom JDialog. I need to hide the JDialog (without removing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.