Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Hide or disable the Windows' application bar
[ All Languages » VB »  Windows]

Total Hit ( 3238)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


The Windows' application bar (or Startbar) is a window like any other window in the system, so you can hide/show and enable/disable it. The only thing you need to know is that that the class name of the Start bar window is "Shell_TrayWnd" and that its window name is a null string. Here is the code that lets you do the trick:

Click here to copy the following block
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
  lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
  ByVal nCmdShow As Long) As Long
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, _
  ByVal fEnable As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5

Sub ShowStartBar(ByVal bVisible As Boolean)
  Dim hWnd_StartBar As Long
  hWnd_StartBar = FindWindow("Shell_TrayWnd", "")
  If bVisible Then
    ShowWindow hWnd_StartBar, SW_SHOW
  Else
    ShowWindow hWnd_StartBar, SW_HIDE
  End If
End Sub

Sub EnableStartBar(ByVal bEnable As Boolean)
  Dim hWnd_StartBar As Long
  hWnd_StartBar = FindWindow("Shell_TrayWnd", "")
  If bEnable Then
    EnableWindow hWnd_StartBar, True
  Else
    EnableWindow hWnd_StartBar, False
  End If
End Sub

If you like concise code you can rewrite the above procedures as follows:

Click here to copy the following block
Sub ShowStartBar(ByVal bVisible As Boolean)
  ShowWindow FindWindow("Shell_TrayWnd", ""), IIf(bVisible, SW_SHOW, SW_HIDE)
End Sub

Sub EnableStartBar(ByVal bEnable As Boolean)
  EnableWindow FindWindow("Shell_TrayWnd", ""), bEnable
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.