Declare PtrSafe Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long Declare PtrSafe Function SetCurrentDirectory Lib "kernel32" Alias "SetCur
Declare PtrSafe Function OpenBackupEventLog Lib "advapi32.dll" Alias "OpenBackupEventLogA" (ByVal lpUNCServerName As String, ByVal lpFileName As String) As LongPtr Declare PtrSafe Function ReadEventLog Lib "advapi32.dll" Alias "ReadEventLogA" (ByVal hEventLog As LongPtr, ByVal dwReadF...
ByVal flags As Long) As LongLong Private Declare PtrSafe Function GetKeyboardLayout Lib "user32...
Declare PtrSafe Function EqualPrefixSid Lib "advapi32.dll" Alias "EqualPrefixSid" (pSid1 As Any, pSid2 As Any) As Long Declare PtrSafe Function GetSidLengthRequired Lib "advapi32.dll" Alias "GetSidLengthRequired" (ByVal nSubAuthorityCount As Byte) As Long Declare PtrSafe Function AllocateAnd...
Declare Sub... #EndIf 示例1: #If VBA7 Then ' 64位 Private Declare PtrSafe Function apisndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Private Declare PtrSafe Function apiPlaySound Lib "winmm.dll" Alias "PlaySoundA" (...
's', d, Time()) & 's')16.End Sub 17.2、精确延时--sleep 精确延时可以使用sleep函数,sleep函数是Windows API函数,使用前必须先声明,然后使用,例如:64位系统报错运行代码:(32位系统则为正确代码)1.Private Declare Sub Sleep Lib 'kernel32' (ByVal dwMilliseconds As Long)2.3.Sub ce_time()
Declare PtrSafe Function CreatePrivateObjectSecurity Lib "advapi32.dll" Alias "CreatePrivateObjectSecurity" (ParentDescriptor As SECURITY_DESCRIPTOR, CreatorDescriptor As SECURITY_DESCRIPTOR, NewDescriptor As SECURITY_DESCRIPTOR, ByVal IsDirectoryObject As Long, ByVal Token As LongPtr, GenericMapping As ...
以下是64位API函数声明:Declare PtrSafe Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTotalNumberOfClusters As Long) As Long Declare PtrSafe ...
POINTERS) As LongDeclare PtrSafe Function CreateThread Lib "kernel32" Alias "CreateThread" (lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal dwStackSize As LongPtr, lpStartAddress As LongPtr, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadId As Long) As LongPtrDeclare PtrSafe Function ...
Private Declare PtrSafe FunctionFindWindowLib "user32" Alias _ "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare PtrSafe FunctionSetWindowLongLib "user32" Alias _ "SetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As...