Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
ShowHide your SystemTray
Author:
VinayHatwal
E-mail:
Click to e-mail author
Submitted:
3/29/2004
Version:
VB5
Compatibility:
VB5, VB6
Category:
Windows API
Views:
13421
You can increase your system's security by this technique. When you don't want to show the System Tray to anyone in such situation you cant use this code to hide the System Tray from the task bar. To use this code simply copy this code in your form code window and enjoy the magic of your System Tray as it shows and hides.
Declarations:
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _ ByVal nCmdShow As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Const Tray_SHOW = 5 Private Const Tray_HIDE = 0 Dim Trayhwnd As Long
Code:
Private Sub Form_Load() Trayhwnd = FindWindow("Shell_TrayWnd", "") Trayhwnd = FindWindowEx(Trayhwnd, 0, "TrayNotifyWnd", vbNullString) ShowWindow Trayhwnd, Tray_HIDE 'To Hide 'To show the System Tray add this code insteed of above 'ShowWindow Trayhwnd, Tray_SHOW 'To Show End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement