How To Hide Desktop Icons of Active Apps?
As the name suggests the Windows Operating System executes the application as different Windows.
User sees the Desktop as the Primary Window and all other visible applications are queued or tiled on Desktop. To take control of these applications, Windows programmers suggest to first find the Handle – a Unique Id that refer to a Application or Window.
Once you find the Handle, then there are plenty of API function available within the OS that can be used to hide desktop icons of these applications. This article has an Excel download app that can be used freely to hide windows from your desktop. I have suggested all the API function that I have used in my app.
Hide Applications in Desktop
If you are an expert in Windows programming, you will be able to suggest plenty of methods to do this. Some people suggest getting the application list from Task manager and then try to get the Window handle from their names.
Other method is to Enumerate function to traverse through all the windows on desktop. But when I try to use it in VBA, the Excel application keeps on terminating. So, I geared up to search for alternate method and found one too.
FindWindowEx: Well, I just used FindWindowEx command recursively to fetch the window Handle. This function will return the handle to all the child windows. The problem is that apart from visible windows, you will also get a big list of applications that are running in the background. In way, this is useful for other programmers who are trying to find whether any malware is running in their computer.
Algorithm to Hide Applications in Windows
Once you get a handle to all Windows, all other jobs are easy to process with Windows API. The Excel App in this app uses the following steps.
- FindWindowEx – Get list of all active Apps.
- IsWindowVisible – Check whether the Apps is visible or not.
- GetWindowText – Get the Windows Title.
- ShowWindowAsync – Use API to make the app hide.
Below is the format of declaration for these functions inside your VBA or VB Coding. Don’t forget to declare these functions inside a module so that it can be reused anywhere.
Public Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long Public Declare Function ShowWindowAsync Lib "user32" (ByVal hwnd As Long, _ ByVal nCmdShow As Long) As Long Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _ (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Public 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
The logic is over. Now go ahead, download Hide Desktop icons of Active Apps with Excel & use it to do some Magic.
Download Free Excel To Hide Applications in Windows Downloaded 330 Times
How to Use: First fetch the list of files by pressing the button “Get App Details”. It will fetch all app list & the 4th column (Column D) there will be a “y” marked for visible apps. Delete the ‘Y’ and leave it blank for any app and click “Hide/Unhide” button. You can see that the particular app becomes hidden. Press the same button again to bring it back. Won’t you feel like a Magician now!!!
Note: This app can also be used to hide desktop itself, if you succeed in finding a handle to it.