Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
My own routine for Copy and Cut!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01097440
Message ID:
01098464
Vues:
11
Hi Ali,

I am not an expert on this but needed it for some other reason just a few days back and got it resolved, mentioned below text can throw some light.
I hope it helps.


One way to trap key switching combinations is to write a keyboard hook. You install a keyboard hook by calling SetWindowsHookEx():
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, hInstance, 0);
The KeyboardProc() function is a callback function that is called by the OS every time a key is pressed. Inside KeyboardProc(), you decide if you want to trap the key or let the OS (or the next application in the hook chain) process it:
  LRESULT KeyboardProc(...)
  {
     if (Key == VK_SOMEKEY)
    return 1;             // Trap key

    return CallNextHookEx(...); // Let the OS handle it
  }
To release the hook, you use:
  UnhookWindowsHookEx(hKeyboardHook);
There are two type of hooks: local and global (or system wide) hooks. Local hooks can only trap events for your application, while global hooks can trap events for all the running applications.


>Hi every body,
>
>I want to replace the procedures for copy (Ctrl-C) and cut (Ctrl-X) with my own routines. Is there any way that I can do that? I want to use my routines when the user presses those keys or clicks corresponding menu items on Edit of main menu. This only happens if the user opens a certain form. Otherwise, they (copy and cut) should do the normal procedure.
>
>Thank you,
>Ali
--
--
Aashish Sharma
Tele Nos: +1-201-490-5405
Mobile: +91-9821053938
E-Mail:
aashish@aashishsharma.com
write2aashish@gmail.com

You better believe in yourself... if you don't, who else will ?
TODAY is a gift, that's why it's called PRESENT
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform