Page 1 sur 1

fcts de kernel32.dll sous lotuscript

MessagePublié: 27 Août 2003 à 14:53
par Stef
bonjour,j'ai des problemes pour utiliser les fcts : globallock, globalunlock and globalfree de la bibliotheque Kernel32.dll sous lotusscript.quelqu'un les a-t-elles deja utilisées ??Merci par avance

Re: fcts de kernel32.dll sous lotuscript

MessagePublié: 27 Août 2003 à 17:01
par Stephane Maillard
Bonjour,Declare Function GlobalLock Lib "kernel32" Alias "GlobalLock" (Byval hMem As Long) As LongDeclare Function GlobalUnlock Lib "kernel32" Alias "GlobalUnlock" (Byval hMem As Long) As LongDeclare Private Function GlobalFree Lib "kernel32" (Byval hMem As Long) As LongExemple :Public Property Set Contents As String Dim lSize As Long Dim hMem As Long Dim pMemory As Long Dim temp As Variant lSize = Len(Contents)+1 hMem = GlobalAlloc(GMEM_MOVABLE Or GMEM_DDESHARE, lSize) If hMem = 0 Or Isnull(hMem) Then Exit Property pMemory = GlobalLock(hMem) If pMemory = 0 Or Isnull(pMemory) Then GlobalFree(hMem) Exit Property End If Call MoveMemory(pMemory, Contents, lSize) Call GlobalUnlock(hMem) If (OpenClipboard(0&) <> 0) Then If (EmptyClipboard() <> 0) Then temp = SetClipboardData(CF_TEXT, hMem) End If temp = CloseClipboard() End If GlobalFree(hMem) End Property[%sig%]