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
| Declare Function ShowWindow Lib "User32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Declare Function SetWindowPos Lib "User32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Declare Function ShowWindowAsync Lib "User32" (ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer
Public Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Sub autreessai()
Dim appHandle As Long
'...
If Application.Wait(Now + TimeValue("0:00:03")) Then
'Pour afficher la fenetre excel
appHandle = FindWindow(vbNullString, Application.Caption)
ShowWindow appHandle, 5
End If
End Sub
Sub test()
Dim appHandle As Long
'...
If Application.Wait(Now + TimeValue("0:00:03")) Then
'Pour afficher la fenetre excel (mettre au 1er plan
appHandle = FindWindow(vbNullString, Application.Caption)
SetWindowPos appHandle, -1, 0, 0, 0, 0, &H40 + &H1 + &H2
End If
End Sub |
Partager