Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My own routine for Copy and Cut!
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01097440
Message ID:
01125762
Views:
13
Thanks Aashish,

I redefined the menu items for Cut and Copy. And it worked for me.

Cheers,
Ali

>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
Previous
Reply
Map
View

Click here to load this message in the networking platform