בוקר טוב חברים.... שאלה .. בעצם אתחיל בסיפור קצר! אני באיזו שהיא תוכנה, עשיתי COPY לאיזו שהיא מחרוזת, ברור שהיא מאוחסנת באיזה שהוא באפר, ועכשיו השאלה.. איך אני מוציא את התוכן של הבאפר הזה, כלומר למה שעשיתי לו COPY מתוך קוד ה VB ????
מתוך API-Guide. שמות הפונקציות והמשתנים מורים על טיבם; רק לקרוא - ולהבין.
Private Const CF_TEXT = 1 Private Declare Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As Long Private Declare Function CloseClipboard Lib "user32" () As Long Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As Long) As Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Long, ByVal ByteLen As Long) Private Sub Form_Load() 'KPD-Team 2001 'URL: http://www.allapi.net/ 'E-Mail: [email protected] Dim hStrPtr As Long, lLength As Long, sBuffer As String OpenClipboard Me.hwnd hStrPtr = GetClipboardData(CF_TEXT) If hStrPtr <> 0 Then lLength = lstrlen(hStrPtr) If lLength > 0 Then sBuffer = Space$(lLength) CopyMemory ByVal sBuffer, ByVal hStrPtr, lLength MsgBox sBuffer, vbInformation End If End If CloseClipboard End Sub