Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Hide the Desktop Icons

PHP Code

<?php 
Imports System
.Runtime.InteropServices

Public Class Form1
    
Public Class ToggleDesktopIcon

        
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        
Private Shared Function FindWindow( _
            ByVal lpClassName 
As String, _
            ByVal lpWindowName 
As String) As IntPtr
        End 
Function

        <
DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        
Private Shared Function GetWindow( _
            ByVal hWnd 
As IntPtr, _
            ByVal uCmd 
As UInteger) As IntPtr
        End 
Function

        Private Enum 
GetWindowCmd As UInteger
            GW_HWNDFIRST 
= 0
            GW_HWNDLAST 
= 1
            GW_HWNDNEXT 
= 2
            GW_HWNDPREV 
= 3
            GW_OWNER 
= 4
            GW_CHILD 
= 5
            GW_ENABLEDPOPUP 
= 6
        End Enum

        
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        
Private Shared Function ShowWindow( _
            ByVal hwnd 
As IntPtr, _
            ByVal nCmdShow 
As Int32) As Boolean
        End 
Function

        Private Enum 
SW As Int32
            Hide 
= 0
            Normal 
= 1
            ShowMinimized 
= 2
            ShowMaximized 
= 3
            ShowNoActivate 
= 4
            Show 
= 5
            Minimize 
= 6
            ShowMinNoActive 
= 7
            ShowNA 
= 8
            Restore 
= 9
            ShowDefault 
= 10
            ForceMinimize 
= 11
            Max 
= 11
        End Enum

        
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        
Private Shared Function IsWindowVisible(ByVal hwnd As IntPtr) As Boolean
        End 
Function

        Public 
Shared Sub Toggle()
            
Dim hWnd As IntPtr = FindWindow("ProgMan", Nothing)
            
hWnd = GetWindow(hWnd, GetWindowCmd.GW_CHILD)

            If 
IsWindowVisible(hWnd) Then
                ShowWindow
(hWnd, SW.Hide)
            Else
                
ShowWindow(hWnd, SW.ShowNoActivate)
            
End If
        
End Sub
    End 
Class

    Private 
Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ToggleDesktopIcon
.Toggle()
    
End Sub
End 
Class 
you need to override the administrator
[Image: OVVpf1F.jpg]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by ImDeepWithWindowsAug 15, 2016 01:37 AM 0 358 Aug 15, 2016 01:37 AM
Last Post: ImDeepWithWindows
[Shell] by ImDeepWithWindowsAug 10, 2016 12:47 PM 2 114 Aug 10, 2016 12:47 PM
Last Post: ImDeepWithWindows
[.NET] by Josh‎May 15, 2015 04:47 AM 3 195 May 15, 2015 04:47 AM
Last Post: Neos07