1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| Option Explicit
#If VBA7 Then
' à voir
Declare PtrSafe Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
' ------------ Théoriquement OK, en pratique ... : Début ---------------
Private Declare PtrSafe Function CreateThread Lib "kernel32" ( _
lpThreadAttributes As SECURITY_ATTRIBUTES, _
ByVal dwStackSize As LongPtr, _
lpStartAddress As LongPtr, _
lpParameter As Any, _
ByVal dwCreationFlags As Long, _
lpThreadId As Long) As LongPtr
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As LongPtr
bInheritHandle As Long
End Type
Declare PtrSafe Function CreateRemoteThread Lib "kernel32" ( _
ByVal hProcess As LongPtr, _
lpThreadAttributes As Any, _
ByVal dwStackSize As LongPtr, _
lpStartAddress As LongPtr, _
lpParameter As Any, _
ByVal dwCreationFlags As Long, _
lpThreadId As Long) As LongPtr
Declare PtrSafe Function GetCurrentThread Lib "kernel32" () As LongPtr
Declare PtrSafe Function GetCurrentThreadId Lib "kernel32" () As Long
Declare PtrSafe Function SetThreadPriority Lib "kernel32" (ByVal hThread As LongPtr, ByVal nPriority As Long) As Long
Declare PtrSafe Function GetThreadPriority Lib "kernel32" (ByVal hThread As LongPtr) As Long
' ------------ Théoriquement OK, en pratique ... : Fin ---------------
'Non OK
'Declare PtrSafe Function GetThreadTimes Lib "kernel32" (ByVal hThread As LongPtr, lpCreationTime As FILETIME, lpExitTime As FILETIME, lpKernelTime As FILETIME, lpUserTime As FILETIME) As Long
Declare PtrSafe Sub ExitThread Lib "kernel32" (ByVal dwExitCode As Long)
Declare PtrSafe Function TerminateThread Lib "kernel32" (ByVal hThread As LongPtr, ByVal dwExitCode As Long) As Long
Declare PtrSafe Function GetExitCodeThread Lib "kernel32" (ByVal hThread As LongPtr, lpExitCode As Long) As Long
'Non OK
'Declare PtrSafe Function GetThreadSelectorEntry Lib "kernel32" (ByVal hThread As LongPtr, ByVal dwSelector As Long, lpSelectorEntry As LDT_ENTRY) As Long
Declare PtrSafe Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As LongPtr, lpdwProcessId As Long) As Long
Declare PtrSafe Function Beep Lib "kernel32" (ByVal dwFreqHz As Long, ByVal dwDurationMs As Long) As Long
Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwDurationMs As LongPtr)
#Else
'---
#End If |
Partager