Solved

Storing informations in keybord keys ctrl

Posted on 2004-04-23
7
193 Views
Last Modified: 2010-04-05
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
0
Comment
Question by:cels9
  • 4
  • 3
7 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10906130
0
 

Author Comment

by:cels9
ID: 10909188
these topics doenst matchs with my q. but, tnx
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 500 total points
ID: 10909259
What part doesn't answer your question?

You register the key sequence (Ctrl + Y)


when its pressed, you can assign it to do what you want - in your case put some text somewhere



  private
    { Private declarations }
    Procedure WMHotkey( Var msg: TWMHotkey ); message WM_HOTKEY;





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;
  End;

procedure TForm1.FormCreate(Sender: TObject);
begin
if RegisterHotKey(Handle,1, MOD_CONTROL ,ord('Yy)) = false then
      MessageDlg('Failed to register Hot Key',mtError,[mbOk],0);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  UnRegisterHotkey( Form1.Handle, 1 );
end;

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:cels9
ID: 10909471
ohh.. sorry. im newb :P tnx! and if i wanna ctrl + F ? :))
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10909481
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;
0
 

Author Comment

by:cels9
ID: 10909529
tnx again
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10909539
NP

<SMILE>

Happy Coding!

Shane
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now