Timer 컨트롤 만들기 (또는 DoEvents()
와 루프에 그것을 가지고) 등처럼 GetClipboardData()
를 사용 FYI
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As Long
Private Declare Function CloseClipboard Lib "user32"() 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 Timer1_Timer()
Dim ptr As Long
OpenClipboard hwnd
ptr = GetClipboardData(49158)
If ptr Then
Dim size As Long
size = lstrlen(ptr)
If size > 0 Then
Dim data As String
data = Space$(size)
CopyMemory ByVal data, ByVal ptr, size
MsgBox data
End If
End If
CloseClipboard
End Sub
: 49158는 "파일 이름"라는 개인 클립 보드 형식이며, 불행히도 사용할 수 없습니다 숫자가 Integer에 비해 너무 높기 때문에 Clipboard.GetData()
을 사용하십시오.
무언가를 복사하면 data
변수에 복사 된 파일 이름이 포함됩니다.
답장을 보내 주셔서 감사합니다.하지만 C#을 사용하지 않습니다 ... vb6.0을 사용하고 있습니다. vb.net에 filewatcher.dll이 있지만 Vb6.0을 선호합니다. –