Startbutton, Taskleiste, Tasksymbole
und Desktopicons ausschalten
[Windows 95/98/NT/2000]

26.07.1998


Folgendes Beispiel schaltet den Startbutton, die Taskleiste,
    die TaskSymbole (incl. Uhr) und die Desktopicons aus.
ERFORDERLICHE OBJEKTE
   4 Checkboxes (Checkbox1-Checkbox4)
   1 CommandButton (Command1)

FORM-CODE

   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
   Private Declare Function SendMessage Lib "user32" Alias _
      "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _
      ByVal wParam As Integer, ByVal lParam As Long) As Long
   Function StartButton(AnAus As Boolean)
      Dim FindClass As Long, Handle As Long
      FindClass& = FindWindow("Shell_TrayWnd", "")
      Handle& = FindWindowEx(FindClass&, 0, "Button", vbNullString)
      If AnAus Then x = 0 Else x = 1
      ShowWindow Handle&, x
   End Function
   Function Taskleiste(AnAus As Boolean)
      Dim Handle As Long
      Handle& = FindWindow("Shell_TrayWnd", vbNullString)
      If AnAus Then x = 0 Else x = 1
      ShowWindow Handle&, x
   End Function
   Function TaskIcons(AnAus As Boolean)
      Dim FindClass As Long, Handle As Long
      FindClass& = FindWindow("Shell_TrayWnd", "")
      Handle& = FindWindowEx(FindClass&, 0, "TrayNotifyWnd", _
         vbNullString)
      If AnAus Then x = 0 Else x = 1
      ShowWindow Handle&, x
   End Function
   Function DesktopIcons(AnAus As Boolean)
      Dim Handle
      Handle = FindWindow("progman", vbNullString)
      If AnAus Then x = 0 Else x = 1
      ShowWindow Handle, x
   End Function
   Private Sub Command1_Click()
      Call StartButton(Check1.Value = 0)
      Call Taskleiste(Check2.Value = 0)
      Call TaskIcons(Check3.Value = 0)
      Call DesktopIcons(Check4.Value = 0)
   End Sub
   Private Sub Form_Load()
      Check1.Caption = "Startbutton sichtbar"
      Check2.Caption = "Taskleiste sichtbar"
      Check3.Caption = "TaskIcons sichtbar"
      Check4.Caption = "DesktopIcons sichtbar"
   End Sub
 

 

Download - 2 KB