Library code snippets

Show/Hide Desktop Icons

This code uses API calls to Hide/Unhide icons on the desktop. Put this code in a Module. Then Call these functions when needed! This code uses FindWindowEx & ShowWindow API Calls to do the job.

API Declarations:

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

Function DesktopIconsShow()
    Dim hwnd As Long
    hwnd = FindWindowEx(0&, 0&, "Progman", vbNullString)
    ShowWindow hwnd, 5
End Function

Function DesktopIconsHide()
    Dim hwnd As Long
    hwnd = FindWindowEx(0&, 0&, "Progman", vbNullString)
    ShowWindow hwnd, 0
End Function

Comments

  1. 28 Nov 2005 at 11:25
    This is the code in C#:

    for(int i =0;i<textBox1.Lines.Length;i++)
    {
    MessageBox.Show(textBox1.Lines.ToString());
    }

    The logic is,

    the textbox,internally consists of an array called Lines that constitutes each line in the multiline textbox.

    ll help u.GOODLUCK
  2. 24 Nov 2005 at 06:38

    Hi
    How to get each line from the multiline textbox in vb.net

  3. 01 Jan 1999 at 00:00

    This thread is for discussions of Show/Hide Desktop Icons.

Leave a comment

Sign in or Join us (it's free).

Adil Hussain Raza Adil is doing MCS from Virtual University Of Pakistan. He is working as a software developer for 3 years. He has developed several customized commercial software in Haroon Abad City for various cli...

Related discussion

Related podcasts

  • Christian Beauclair

    14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...

We'd love to hear what you think! Submit ideas or give us feedback