So i've been trying to get the code on this example to work:
I currently just use a simple button to execute SW_HIDE, but this also removes access and the form from the task bar, I was wondering if there is a way to keep the form on the task bar?
Thanks in advance.
Code:
Option Compare Database
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
'###############################################
#If VBA7 Then
Private Declare PtrSafe Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
#ElseIf Win64 Then 'need datatype LongPtr
Private Declare PtrSafe Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As LongPtr, ByVal nCmdShow As LongPtr) As LongPtr
#Else '32-bit Office
Private Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
#End If
'###############################################
Function SetAccessWindow(nCmdShow As Long)
'Usage Examples
'Maximize window:
' ?SetAccessWindow(SW_SHOWMAXIMIZED)
'Minimize window:
' ?SetAccessWindow(SW_SHOWMINIMIZED)
'Hide window:
' ?SetAccessWindow(SW_HIDE)
'Normal window:
' ?SetAccessWindow(SW_SHOWNORMAL)
Dim loX As Long
' Dim loForm As Form
On Error Resume Next
loX = apiShowWindow(hWndAccessApp, nCmdShow)
SetAccessWindow = (loX <> 0)
End Function
I currently just use a simple button to execute SW_HIDE, but this also removes access and the form from the task bar, I was wondering if there is a way to keep the form on the task bar?
Thanks in advance.