Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

Using my MFC application, i have to disable Copy/Cut/Paste/Delete from the windows system, i was successful in disabling those while using keyboard shotcuts(Ctrl+C,Ctwhen trl+v,Ctrl+X,Ctrl+D) but i am struck for disabling the same on right click options,so that if the user try to do copy,cut,paste,delete operations through right click of mouse the those options should show disabled,

I have done the same kind of thing for disabling "Start Task Manager"(when the user right clicks on the taskbar) by changing the registry value name "DisableTaskMgr" and Value data as 1 in the registry settings,and i was successful using this.

Is there any specific registry value name to set in the registry to disable Copy/Cut/Paste/Delete options from right click or is there any other way to do it in MFC.


,kindly can any one suggest me for the same.


Thanks in Advance.
Posted
Updated 11-Oct-12 18:16pm
v4
Comments
Sergey Alexandrovich Kryukov 25-Sep-12 23:41pm    
Why?!
--SA
Argonia 10-Oct-12 10:42am    
if these Copy/Cut/Paste/Delete are buttons you can catch the message WM_CONTEXMENU (if you want to disable them if the context menu is activated ) or WM_RBUTTONDOWN for just a click .You can disable them with CButton::EnableWindow(FALSE / TRUE)
Rocky_Bas 12-Oct-12 0:05am    
Hi Argonia,thanks for the reply.But i have to disable this copy cut paste delete keys from the windows not on the application iam running.

I was successfull to disable the key board shotcut keys for the same,but i have disable those options even in the mouse right click.Because can even do copy,cut,paste,delete through mouse,so kindly suggest me for it.

 
Share this answer
 
Comments
Rocky_Bas 5-Oct-12 5:10am    
Hi Joan,i am able to track the keyboard and mouse events using Hooks,but how to exactly stop to do that particular operation.

I mean to say ,i the user is pressing delete button ,at this moment after tracking the delete event how to stop him deleting.
Joan M 5-Oct-12 5:19am    
Well, it all depends on the method you are using to capture the keystrockes, but typically there is a return value on the capture functions that will allow you to continue processing the message or not.
I don't know which method you've chosen, but take a look at the return value of the function you are using to pre-handle the keystrokes.
Rocky_Bas 5-Oct-12 5:28am    
In the KeyStroke function i have kept a condition
if(wParam == VK_DELETE)
so with this condition i can know user has pressed delete button in the keyboard,now in this i need to return some thing so that user cant do delete.
Joan M 5-Oct-12 5:34am    
I'm sorry but I don't know the "keystroke" function... are you using the pretranslate message? handling any message? Well, I'm sure you are handling a message as you have the wparam parameter here but... which one it is?
Rocky_Bas 5-Oct-12 5:38am    
KeyStroke function means it capture the events of keyboard
Don't do it. The reasonable users won't forgive such abuse. Better explain why do you think you would need it, to get better advice.

—SA
 
Share this answer
 
Comments
Rocky_Bas 25-Sep-12 23:47pm    
Hi Sergey,

These are the rights i need to provide in my application,that's the reason i want disable and if required enable those.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900