Bonjour tout le monde,
j’ai retrouvé un ancien fichier que vous, les pros du VBA, m’aviez fait une fois.
Alors je me souviens plus de toutes cos explications et sens des codes. C’est pour cela que j’aurai bien voulu savoir a quoi sert les 2 lignes suivantes dans le code "Private Sub Workbook_Open() ";
hWnd = FindWindowA(vbNullString, Application.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF
ainsi que les lignes dans le code ci dessous
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim hWnd As Long
hWnd = FindWindowA(vbNullString, Application.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H80000
End Sub
des codes ci-dessous qui sont en gras. Ces codes se trouvent dans le ThisWorkbook du fichier.
Option Explicit
Private Declare PtrSafe Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function GetWindowLongA Lib "user32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLongA Lib "user32" _
(ByVal hWnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Sub Workbook_Open()
Dim hWnd As Long
hWnd = FindWindowA(vbNullString, Application.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF
Application.ScreenUpdating = False
Application.Visible = False
CODE_ACCES_LOGICIEL.Show
Call Cacher
Call titre
Sheets("ACCUEIL LOGICIEL").Activate 'Afficher la page "ACCUEIL LOGICIEL"
If Application.EoMonth(Date, 0) = Date Then 'Affiche le dernier jour du mois, une information urgente afin de ne pas oublier de clore le mois en cours
FIN_DES_MOIS.Show
End If
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim hWnd As Long
hWnd = FindWindowA(vbNullString, Application.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H80000
End Sub
Je vous remercie d’avance.
Rubis