How to disable copy/paste commands in the Windows edit control context menu?

前端 未结 4 1931
陌清茗
陌清茗 2020-12-16 05:38

How can I disable those 3 standard cut/copy/paste commands in the context menu of the native Windows OS edit control?

I also need to disable the equivalent

4条回答
  •  有刺的猬
    2020-12-16 06:24

    One approach (similar to hypmir's idea but not quite as intrusive) is to simply overwrite the clipboard with "DATA REMOVED BY TecMan" whenever it is updated. You could do this as a registered clipboard viewer.
    Open the clipboard, clear all formats, add CF_TEXT with the notice, close it. I would use a short delay (maybe a timer callback) so that you make your update AFTER the first update has been processed by any other registered clipboard viewers on the system. Your mileage may vary. Abusing the clipboard like this is never a good idea.

提交回复
热议问题