DeleteTabメソッド(タスクバーのアイテムを削除) Dim objTaskbar As New TaskbarList objTaskbar.HrInit objTaskbar.DeleteTab Me.hwnd Set objTaskbar = Nothing
AddTabメソッド(タスクバーにアイテムを追加) Dim objTaskbar As New TaskbarList objTaskbar.HrInit objTaskbar.AddTab Me.hwnd objTaskbar.ActivateTab Me.hwnd Set objTaskbar = Nothing
Option Explicit Private oTaskbar As TaskbarList Private Sub Command1_Click() oTaskbar.AddTab Me.hWnd 'タスクバーに表示 End Sub Private Sub Command2_Click() oTaskbar.DeleteTab Me.hWnd 'タスクバーから削除 End Sub Private Sub Form_Load() Set oTaskbar = New TaskbarList End Sub Private Sub Form_Unload(Cancel As Integer) Set oTaskbar = Nothing End Sub