1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Option Explicit
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function FindWindowByClass Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal NullPointer As Long) As Long
Const SW_RESTORE As Long = 9
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function IsIconic Lib "user32" (ByVal hWnd As Long) As Long
Private Sub cmdDePptQuit_Click()
Dim hWnd As Long
hWnd = FindWindowByClass("XLMain", 0)
If hWnd Then
If IsIconic(hWnd) Then
ShowWindow hWnd, SW_RESTORE
End If
SetForegroundWindow hWnd
End If
Application.Quit
End Sub |
Partager