Oppure

Loading
Questo topic e' stato chiuso dal moderatore.
09/01/11 18:34
perfection6989
Come faccio a nascondere le icone del desktop in Windows 7?
C'è qualche istruzione che mi può essere d'aiuto?
aaa
09/01/11 18:41
DeviorDen
nel senso nascondere i file o solo non farle vedere? se è solo non farle vedare fai tasto destro sul desktop e poi visualizza è poi togli la spunta da mostra icone :)
aaa
09/01/11 18:44
perfection6989
il risultato che voglio ottenere è quello ma attraverso codice....:_doubt:
aaa
09/01/11 19:22
perfection6989
risolto da solo :k:
Imports System.Runtime.InteropServices

Public Class Form1


    <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

   


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim hWnd As IntPtr = FindWindow("ProgMan", Nothing) 'Nasconde le icone del desktop
        hWnd = GetWindow(hWnd, GetWindowCmd.GW_CHILD)

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

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim hWnd As IntPtr = FindWindow("Shell_traywnd", Nothing) 'Nasconde solo la Trayicon bar
        hWnd = GetWindow(hWnd, GetWindowCmd.GW_CHILD)

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

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim hWnd As IntPtr = FindWindow("Shell_TrayWnd", Nothing) 'Nasconde tutta la barra delle applicazioni


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

aaa