Link to home
Start Free TrialLog in
Avatar of cels9
cels9

asked on

Storing informations in keybord keys ctrl

Hi,
How storage a text in a specificate key(for exemple: ctrl + Y), and when i press it, paste the text, in a form, for exemple. tnx
Avatar of shaneholmes
shaneholmes

Avatar of cels9

ASKER

these topics doenst matchs with my q. but, tnx
ASKER CERTIFIED SOLUTION
Avatar of shaneholmes
shaneholmes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cels9

ASKER

ohh.. sorry. im newb :P tnx! and if i wanna ctrl + F ? :))
if RegisterHotKey(Handle,2, MOD_CONTROL ,ord('f')) = false then
      MessageDlg('Failed to register Hot Key',mtError,[mbOk],0);


procedure TForm1.WMHotkey( Var msg: TWMHotkey );
  Begin
    If msg.hotkey = 1 Then
   Begin
    //paste the text you want to paste where you want to paste it!
    // example
   //edit1.text:= SomeText;
   End
  else
    If msg.hotkey = 2 Then
   Begin
    //paste the text you want to paste where you want to paste it!
    // example
   //edit1.text:= SomeText;
   End
  End;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  UnRegisterHotkey( Form1.Handle, 2 );
end;
Avatar of cels9

ASKER

tnx again
NP

<SMILE>

Happy Coding!

Shane