'**********************************************************************************
' __ _____ ___ . ___ _____ ___ ___
'|__| /\ | | | | | | / | | | | | | | | |\ |
'| /__\ | |--- | | |/\ | | | | | | | | | \ |
'| / \ | | \ | |___ | \ | |___| |___| |__ |___| | \|
'***********************************************************************************
' COLLECTION API AVEC MACRO4 EPISODE 1
'userform réductibe dans la barre des taches
Private Sub UserForm_Activate()
Dim HwnD&
'recupérer le handle de la fenêtre active
HwnD = ExecuteExcel4Macro("CALL(""user32"",""GetActiveWindow"",""JCC"")") 'api GetActiveWindow
ExecuteExcel4Macro ("CALL(""user32"",""SetWindowLongA"",""JJJJJ""," & HwnD & ", " & -16 & ", " & (&H94C80080 Or &H94CF8080) & ")")
' ici on va determiner sa position en mode reduit c'est a dire en l'occurence dans la barre des tache
' et non reduit sur la gauche audessus comme à l'origine
ExecuteExcel4Macro ("CALL(""user32"",""SetWindowPos"",""JJJJJJJJ""," & HwnD & ", " & 0 & ", " & 0 & ", " & 0 & ", " & 0 & ", " & 0 & ", " & (&H1 Or &H2 Or &H10 Or &H80) & ")")
ExecuteExcel4Macro ("CALL(""user32"",""SetWindowLongA"",""JJJJJ""," & HwnD & ", " & -20 & ", " & &H40101 & ")") 'api SetWindowLongA
ExecuteExcel4Macro ("CALL(""user32"",""SetWindowPos"",""JJJJJJJJ""," & HwnD & ", " & 0 & ", " & 0 & ", " & 0 & ", " & 0 & ", " & 0 & ", " & (&H1 Or &H2 Or &H10 Or &H40) & ")")
End Sub