patriciaxxx
Programmer
Below is my code so far:
It accepts the Form name as Me.hWnd
It allows to choose True or False (to say whether to put Form in taskbar)
But it only seems to have an effect on popup Forms.
Does anyone know how to modify it to work for all types of Form?
It accepts the Form name as Me.hWnd
It allows to choose True or False (to say whether to put Form in taskbar)
But it only seems to have an effect on popup Forms.
Does anyone know how to modify it to work for all types of Form?
Code:
[COLOR=#204A87]Option Compare Database
Option Explicit
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Const WS_EX_APPWINDOW = &H40000
Private Const GWL_STYLE = -20
Public Function ShowInTaskbar(Lhwnd As Long, Show As Boolean)
Dim lStyle As Long
lStyle = GetWindowLong(Lhwnd, GWL_STYLE)
If Show Then
lStyle = lStyle Or WS_EX_APPWINDOW
Else
lStyle = lStyle And Not WS_EX_APPWINDOW
End If
Call SetWindowLong(Lhwnd, GWL_STYLE, lStyle)
End Function
[/color]