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
|
' Exemple de déclaration compatible avec 64 bit tiré du fichier "redimensionner userform.xlm"
' voir également pour formation le documet sur le net "compatibilité entre les version 64 bits et 32 bits sur d'office 2010"
Option Explicit
#If VBA7 Then
' api pour changer le mode d affichage du userform et activer ou non la fenetre
Public Declare PtrSafe Function SWH Lib "user32" Alias "ShowWindow" (ByVal hwnd As LongPtr, ByVal nCmdShow As Long) As Long
' api pour changer le mode d affichage du userform et activer ou non la fenetre
Public Declare PtrSafe Function SWA Lib "user32" Alias "ShowWindowAsync" (ByVal hwnd As LongPtr, ByVal nCmdShow As Long) As Long
' api pour redresser l'affichage en cas de modification de la caption
Public Declare PtrSafe Function DMB Lib "user32" Alias "DrawMenuBar" (ByVal hwnd As LongPtr) As Long
' api pour trouver et identifier le handle de la fenetre (identifiant de la fenetre
Public Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
#If Win64 Then
Public Declare PtrSafe Function GWLA Lib "user32" Alias "GetWindowLongPtrA" (ByVal hwnd As LongPtr, ByVal nIndex As Long) As LongPtr
Public Declare PtrSafe Function SWLA Lib "user32" Alias "SetWindowLongPtrA" (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr
#Else
'api pour appliquer le nouveau style a la fenetre (userform)
Public Declare PtrSafe Function GWLA Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As LongPtr, ByVal nIndex As Long) As LongPtr
Public Declare PtrSafe Function SWLA Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr
#End If
#Else
'api pour trouver et identifier le handle de la fenetre (identifiant de la fenetre
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'api pour appliquer le nouveau style a la fenetre (userform)
Public Declare Function GWLA Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SWLA Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
'api pour redresser l'affichage en cas de modification de la caption
Public Declare Function DMB Lib "user32" Alias "DrawMenuBar" (ByVal hwnd As Long) As Long
'api pour changer le mode d affichage du userform et activer ou non la fenetre
Public Declare Function SWH Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
' api pour changer le mode d affichage du userform et activer ou non la fenetre
Public Declare Function SWA Lib "user32" Alias "ShowWindowAsync" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
#End If |
Partager