Does anyone know how to activate a window that is currently minimized on the taskbar?
I have tried the following code but the focus remains with my Visual Basic Application instead of the rquired window.

Declare Function BringWindowToTop Lib "user32" (ByVal hWnd As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal aint As Integer) As Integer
Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Integer) As Long
Public Const GW_HWNDNEXT = 2
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hWnd As Long) As Long
Declare Function SetActiveWindow Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

Public Sub ActivateWindowByTitle(ByVal WndCap As String)
Dim hWndFrame As Long
hWndFrame = FindWindowPartial(WndCap)
If hWndFrame <> 0 Then
' Activate the window
'Call BringWindowToTop(hWndFrame)
Call SetForegroundWindow(hWndFrame)
'Call SetActiveWindow(hWndFrame)
'Call ShowWindow(hWndFrame, 1)
Call ShowWindow(hWndFrame, 10)
End If
End Sub

Public Function FindWindowPartial(ByVal TitlePart As String) As Long
Dim hWndTmp As Long
Dim nRet As Integer
Dim TitleTmp As String
TitlePart = UCase$(TitlePart)
hWndTmp = FindWindow(0&, 0&)

Do Until hWndTmp = 0
TitleTmp = Space$(256)
nRet = GetWindowText(hWndTmp, TitleTmp, Len(TitleTmp))
If nRet Then
TitleTmp = UCase$(VBA.Left$(TitleTmp, nRet))
If InStr(TitleTmp, TitlePart) Then
FindWindowPartial = hWndTmp
Exit Do
End If
End If
hWndTmp = GetWindow(hWndTmp, GW_HWNDNEXT)
Loop
End Function

Private Sub CmdTest_Click()
Call ActivateWindowByTitle("Notepad")
End If