Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to Hide another application's tray icon?

How to Hide another application's tray icon?

Scheduled Pinned Locked Moved C#
questionjsontutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    the_one2003a
    wrote on last edited by
    #1

    Hi Recently I needed to hide an application window so I used the ShowWindow of the API and could hide it from taskbar But this application has a tray icon too, How can I hide tray icon? And also is there a way to make the application to stay at background completely what I mean is that when I use ShowWindow function This application is show for a second an then is hidden so it is visibile for half of a second. Is there any better way to make it invisible completely? Michael Lopez

    L S 2 Replies Last reply
    0
    • T the_one2003a

      Hi Recently I needed to hide an application window so I used the ShowWindow of the API and could hide it from taskbar But this application has a tray icon too, How can I hide tray icon? And also is there a way to make the application to stay at background completely what I mean is that when I use ShowWindow function This application is show for a second an then is hidden so it is visibile for half of a second. Is there any better way to make it invisible completely? Michael Lopez

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, you can send Windows commands to the tray icons, making them invisible, or even removing them alltogether. Although its purpose is slightly different, you may find a lot of details about it in my TrayIconBuster article. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google


      T 1 Reply Last reply
      0
      • T the_one2003a

        Hi Recently I needed to hide an application window so I used the ShowWindow of the API and could hide it from taskbar But this application has a tray icon too, How can I hide tray icon? And also is there a way to make the application to stay at background completely what I mean is that when I use ShowWindow function This application is show for a second an then is hidden so it is visibile for half of a second. Is there any better way to make it invisible completely? Michael Lopez

        S Offline
        S Offline
        sam
        wrote on last edited by
        #3

        Is there any need of Win Form in your application ? You can Create windows Services. You can Create Two Applications one will call another. and you can use windows Handles to Hide your Window

        T 1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, you can send Windows commands to the tray icons, making them invisible, or even removing them alltogether. Although its purpose is slightly different, you may find a lot of details about it in my TrayIconBuster article. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google


          T Offline
          T Offline
          the_one2003a
          wrote on last edited by
          #4

          Hi Thanks I could hide the tray icon. So I wanted to make it Permanent I mean My applicaiton should always check and hide this application If it has become visible again (Remove both taskbar and trayicon again) So I used code below (most of your code) But Application's main windows only becomes hidden one time and not for other times. if (filename != null) { filename = filename.ToLower(); if (filename.Contains("application.exe")) { //To get the Application Main handle (hide from taskbar) p = Process.GetProcessesByName("Application"); hWnd1 = (int)p[0].MainWindowHandle; ShowWindow((int)hWnd1, SW_HIDE); //This one works fine and always hides app's tray icon SOK = (uint)SendMessage(hWnd, TB_DELETEBUTTON, new IntPtr(item2), IntPtr.Zero); if (SOK != 1) throw new ApplicationException("TB_DELETEBUTTON failed"); removedCount++; }

          1 Reply Last reply
          0
          • S sam

            Is there any need of Win Form in your application ? You can Create windows Services. You can Create Two Applications one will call another. and you can use windows Handles to Hide your Window

            T Offline
            T Offline
            the_one2003a
            wrote on last edited by
            #5

            What I need to make is a stealth interface to another application. My application should run and always check to be sure that the second application is always hidden (Fron both Taskbar and TrayIcon)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups