Home » System & API » How to Change the visibility of the app in the taskbar at runtime
How to Change the visibility of the app in the taskbar at runtime
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 'System & API - How to Change the visibility of the app in the taskbar at runtime Option Explicit 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 Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, _ ByVal nCmdShow As Long) As Long Private Const SW_HIDE = 0 Private Const SW_SHOW = 5 Private Const GWL_EXSTYLE = (-20) Private Const WS_EX_APPWINDOW = &H40000 Private Sub TaskbarVisible(hWnd As Long, visible As Boolean) Dim wl As Long ShowWindow hWnd, SW_HIDE wl = GetWindowLong(hWnd, GWL_EXSTYLE) If visible = False Then wl = wl And Not WS_EX_APPWINDOW Else wl = wl Or WS_EX_APPWINDOW End If SetWindowLong hWnd, GWL_EXSTYLE, wl ShowWindow hWnd, SW_SHOW End Sub Private Sub cmdHide_Click() TaskbarVisible Me.hWnd, False End Sub Private Sub cmdShow_Click() TaskbarVisible Me.hWnd, True End Sub |
Related posts:
- How to Set the ShowInTaskBar Property at Runtime
- How to Show/Hide all Desktop Icons
- How to Create a Menu completely at Runtime
- How to disable builtin right click context menu in text box
- How to create form and controls dynamically
- How to Hide Taskbar
- How to Show Taskbar
- How to align Caption on Command Button
- How to uppercase the text entered in text box using API
- How to lowercase the text entered in text box using API
Enjoy this article?
Filed under: System & API
Leave a comment
Sponsors
Link Back to us
Donations
If you are benefited from this site, please donate a small contribution to us. It will help to maintain this site better.