在这个剪切板功能里面,32bit和64bit主要的差异:
1.64 bit的Declare 后必须有PtrSafe
2.64 bit的指针\句柄必须使用LongPtr类型
32 bit:
Private Declare Function OpenClipboard Lib "user32.dll" ( _
ByVal hWnd As Long) As Long
Private Declare Function GetClipboardData Lib "user32.dll" ( _
ByVal wFormat As Long) As Long
Private Declare Function CloseClipboard Lib "user32.dll" () As Long
64 bit:
Private Declare PtrSafe Function OpenClipboard Lib "user32.dll" ( _
ByVal hWnd As LongPtr) As Long
Private Declare PtrSafe Function GetClipboardData Lib "user32.dll" ( _
ByVal wFormat As LongPtr) As Long
Private Declare PtrSafe Function CloseClipboard Lib "user32.dll" () As Long