VB原始碼推薦: 動態的顯示/隱藏start按鈕 (轉)

worldblog發表於2007-12-02
VB原始碼推薦: 動態的顯示/隱藏start按鈕 (轉)[@more@]

VB推薦 : 動態的顯示/隱藏start按鈕

' #VBUtils#**********************************************
' * Programmer Name : Waty Thierry
' * Site :
' * E- : waty.thierry@usa
' * Date : 22/10/98
' * Time : 15:50
' * Module Name : Start_Module
' * Module Filename : Start.bas
' *********************************************************
' * Comments : Show/Hide the start button
' *
' ********************************************************
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 Declare Function ShowWindow Lib "user32" _
 (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Public Function hideStartButton()
 'This Function Hides the Start Button'
 OurParent& = FindWindow("_TrayWnd", "")
 OurHandle& = FindWindowEx(OurParent&, 0, "Button", _
 vbNullString)
 ShowWindow OurHandle&, 0
End Function

Public Function showStartButton()
 'This Function Shows the Start Button'
 OurParent& = FindWindow("Shell_TrayWnd", "")
 OurHandle& = FindWindowEx(OurParent&, 0, "Button", _
 vbNullString)

 ShowWindow OurHandle&, 5
End Function

 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-987499/,如需轉載,請註明出處,否則將追究法律責任。

相關文章