Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable Clipboard function
Message
 
To
18/05/2005 02:42:04
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01011882
Message ID:
01015213
Views:
22
>Dear Anatoliy,
>
>Thanks for your response, could you assist me to get the SetClipboardViewer API, because I open already the API hyperlink then search for that fucntion but not found.
>
>Thank you so much.
>
>Regards,
>Hendry Setiawan

It is always a good Idea to show what version of VFP you use.
Here some example form SetClipboardViewer function.
DECLARE INTEGER SetClipboardViewer IN WIN32API INTEGER
SetClipboardViewer(thisform.hWnd)
but I don't know how to catch this event in form.

Here an example writen in VB. If someone point me how to rewrite this "AddressOf WindowProc" to VFP I can rewrite the code in VFP :o(
'Create a new project, add a module to it
'Add a command button to Form1
'In the form
Private Sub Form_Load()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    'Subclass this form
    HookForm Me
    'Register this form as a Clipboardviewer
    SetClipboardViewer Me.hwnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
    'Unhook the form
    UnHookForm Me
End Sub
Private Sub Command1_Click()
    'Change the clipboard
    Clipboard.Clear
    Clipboard.SetText "Hello !"
End Sub

'In a module
'These routines are explained in our subclassing tutorial.
'http://www.allapi.net/vbtutor/subclass.php
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function SetClipboardViewer Lib "user32" (ByVal hwnd As Long) As Long
Public Const WM_DRAWCLIPBOARD = &H308
Public Const GWL_WNDPROC = (-4)
Dim PrevProc As Long
Public Sub HookForm(F As Form)
    PrevProc = SetWindowLong(F.hwnd, GWL_WNDPROC, AddressOf WindowProc)
End Sub
Public Sub UnHookForm(F As Form)
    SetWindowLong F.hwnd, GWL_WNDPROC, PrevProc
End Sub
Public Function WindowProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    WindowProc = CallWindowProc(PrevProc, hwnd, uMsg, wParam, lParam)
    If uMsg = WM_DRAWCLIPBOARD Then
        MsgBox "Clipboard changed ..."
    End If
End Function
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform