Option Explicit
Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Public Const GW_OWNER = 4 Public Const SW_HIDE = 0 Public Const SW_SHOW = 5 'Hide the app from the task manager. Public Sub HideApp(ByVal mainFrmHwnd As Long) Dim lRtn As Long lRtn = GetWindow(mainFrmHwnd, GW_OWNER) lRtn = ShowWindow(lRtn, SW_HIDE) End Sub 'Show the app from the task manager. Public Sub ShowApp(ByVal mainFrmHwnd As Long) Dim lRtn As Long lRtn = GetWindow(mainFrmHwnd, GW_OWNER) lRtn = ShowWindow(lRtn, SW_SHOW) End Sub |