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_magic of Start Button
Author:
VinayHatwal
E-mail:
Click to e-mail author
Submitted:
3/29/2004
Version:
VB5
Compatibility:
VB5, VB6
Category:
Windows API
Views:
13784
You can increase your system's security by this technique. When you don't want to show the start button to anyone. In such situation you cant use this code to hide the Start Button from the task bar. To use this code simply copy this code in your form code window and enjoy the magic of your Start Button 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, yVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Const BUT_SHOW = 5 Private Const BUT_HIDE = 0 Dim Butttonhwnd As Long
Code:
Private Sub Form_Load() Butttonhwnd = FindWindow("Shell_TrayWnd", "") Butttonhwnd =FindWindowEx(Butttonhwnd,0,"Button", _ vbNullString) ShowWindow Butttonhwnd, BUT_HIDE 'To Hide 'To show the Start Button add this code 'insteed od above code 'ShowWindow Butttonhwnd, BUT_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