Hide Start button

xiaoxiao2021-03-06  44

The following code in the module Option ExplicitPublic Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As LongPublic Const HWND_DESKTOP = 0Public Const SWP_HIDEWINDOW = & H80Public Const SWP_SHOWWINDOW = & H40Public Declare Function FindWindow Lib "user32" Alias ​​"FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPublic Declare Function GetWindow Lib "user32" (ByVal hwnd As Long , ByVal wCmd As Long) As LongPublic Declare Function GetClassName Lib "user32" Alias ​​"GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As LongPublic Const GW_CHILD = 5Public Const GW_HWNDNEXT = 2 the following code in the form in Option ExplicitPrivate Sub Command1_Click () Dim hTaskbar as Long, hStartbutton as LongDim sClass as String * 250hTaskbar = FindWindow ( "Shell_traywnd", vbNullString) 'Shell_traywnd class name hStartbutton taskbar = GetWindow (hTaskbar, GW_CHILD) doGet ClassName hStartbutton, sClass, 250If LCase (Left (sClass, 6)) = "button" Then Exit DohStartbutton = GetWindow (hStartbutton, GW_HWNDNEXT) LoopSetWindowPos hStartbutton, 0, 0, 0, 0, 0, SWP_HIDEWINDOWEnd SubPrivate Sub Command2_Click () Dim hTaskbar As Long, hStartbutton As LongDim sClass As String * 250hTaskbar = FindWindow ( "Shell_traywnd", vbNullString) hStartbutton = GetWindow (hTaskbar, GW_CHILD) DoGetClassName hStartbutton, sClass, 250If LCase (Left (sClass, 6)) = "button" Then Exit DohStartbutton = GetWindow (hstartbutton, gw_hwndnext) loopsetwindowpos hstartbutton, 0, 0, 0, 0, 0, swp_showwindownd sub

转载请注明原文地址:https://www.9cbs.com/read-59393.html

New Post(0)