tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
I want to find a conversion for the Sleep API.
Should it be:
or
I have seen another API and it's very complicted:
Thanks
Should it be:
Rich (BB code):
Rich (BB code):
I have seen another API and it's very complicted:
Rich (BB code):
#If VBA7 Then ' (OFFICE 2010 AND LATER - Either 32bit or 64bit Editions)
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As LongPtr
#If Win64 Then '(64bit OS) AND (64bit Office)
Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongPtrA" (ByVal hWnd As LongPtr, _
ByVal nIndex As Long) As LongPtr
Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongPtrA" (ByVal hWnd As LongPtr, _
ByVal nIndex As Long, _
ByVal dwNewLong As LongPtr) As LongPtr
#Else ' (32 or 64 bit OS) AND (32bit Office)
Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As LongPtr, _
ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As LongPtr, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
#End If
#Else ' (OFFICE 2007 AND BEFORE) .. Both (32bit OS) AND (32bit Office)
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
#End If
Private Const WS_SYSMENU = &H80000
Private Const GWL_STYLE = (-16)