Que veut dire: Application.Volatile ? ...
ce matin, je suis tombé sur un site où l'on traitait su même sujet, une des participants à mis un code de Frédéric Sigonneau, qui permettait d'avoir ces informations et bien plus.
Declare Function GetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Sub CACHER_BANDE_BLEUE(USF As UserForm)
Dim hWnd&
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", USF.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And Not &HC00000: DrawMenuBar hWnd
End Sub
Sub CACHER_CROIX(USF As UserForm) ' Ceci pourrait servir plus tard, et laisser le droit de déplacer l'USF
Dim hWnd&
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", USF.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF
End Sub
MJ: je ne comprends pas pourquoi il m'affiche 32Bits alors que j'en ai 64. Une idée?
Sub Test_version()
Dim Version As String
Version = Application.ExecuteExcel4Macro("get.workspace(1)")
MsgBox Version
End Sub
Declare PtrSafe Function GetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare PtrSafe Function SetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Sub CACHER_BANDE_BLEUE(USF As UserForm)
Dim hWnd&
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", USF.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And Not &HC00000: DrawMenuBar hWnd
End Sub
Sub CACHER_CROIX(USF As UserForm) ' Ceci pourrait servir plus tard, et laisser le droit de déplacer l'USF
Dim hWnd&
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", USF.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF
End Sub
Pour rendre compatible un code pour les versions 32 et 64 bit, regarde la réponse que j'avais faite sur ce fil et le lien que j'avais indiqué :Je pensais donc utiliser le code précédent pour savoir si oui ou non je pouvais appeler le module ci-dessus
(32 => Oui; 64 => Non) ....... Car je n'ai toujours pas trouvé la correspondance pour les versions en 64 Bits)
A+
Si tu parles de la macro Excel4, je suis en 64 bit et c'est ce que le résultat me renvoie.C'est pas de bol david, le message m'affiche toujours 32Bits.