Announcement

Collapse
No announcement yet.

How can I invalidate Copy and Paste options in Windows?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I invalidate Copy and Paste options in Windows?

    I need to cancel the possibility to Copy and Paste what is on the screen, for security of the data that is displayed on the screen.
    How can I invalidate the Ctrl-C, Ctrl-V in the keyboard or the right button in the mouse for copy and paste?



    ------------------

  • #2
    Under Win2000 this exactly works, under another OSes - not tested, but should work also.
    Code:
       #Compile Exe
       #Dim All
       #Register None
       #Include "Win32Api.Inc"
       CallBack Function DlgProc
          Dim hwndNextViewer As Static Long, hData As Asciiz Ptr, Active As Static Long
          Select Case CbMsg
             Case %WM_ACTIVATEAPP
                If CbWparam Then SetWindowText CbHndl, "Clipboard doesn't work": Active = 1 Else _
                                 SetWindowText CbHndl, "Clipboard works": Active = 0
             Case %WM_INITDIALOG
                hwndNextViewer = SetClipboardViewer(CbHndl)
             Case %WM_CHANGECBCHAIN
                If CbWparam = hwndNextViewer Then hwndNextViewer = CbLparam Else _
                If hwndNextViewer <> 0 Then SendMessage hwndNextViewer, CbMsg, CbWparam, CbLparam
             Case %WM_DESTROY
                ChangeClipboardChain CbHndl, hwndNextViewer
             Case %WM_DRAWCLIPBOARD
                If Active Then
                   If OpenClipBoard(0) Then EmptyClipBoard: CloseClipboard
                   SendMessage hwndNextViewer, CbMsg, CbWparam, CbLparam
                End If
          End Select
       End Function
       Function PbMain
          Local hDlg As Long
          Dialog New 0, "Test", ,, 300, 200, %WS_CAPTION Or %WS_SYSMENU, %WS_EX_TOPMOST To hDlg
          Dialog Show Modal hDlg Call DlgProc
       End Function
    ------------------
    E-MAIL: [email protected]

    Comment

    Working...
    X