If form's border is set to 0 (none) but ShowInTaskbar is True - icon will not appear unless you do something like the following:
VB Code:
Option Explicit Private Const GWL_STYLE = (-16) Private Const WS_SYSMENU = &H80000 Private Const WS_MINIMIZEBOX = &H20000 Private Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Sub Form_Load() Dim lStyle As Long 'ensure taskbar icon visibility lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) Or WS_SYSMENU Or WS_MINIMIZEBOX SetWindowLong Me.hwnd, GWL_STYLE, lStyle End Sub




Reply With Quote