Getting Task Manager cleared off when my C# app is running!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bijukoshy82
    New Member
    • Oct 2008
    • 1

    Getting Task Manager cleared off when my C# app is running!

    Hi

    I am in process of developing a C# application to do some printing operations.For this i am using macros that was used previuosly in the VB version.
    Basically, this app will look for the docs to be printed in every 10 seconds.The logic is being implemented in a Timer_Tick event. In this event i am changing the app icon to show the status(Red or Green). This app will be running continously. I am destroying the icon to avoid memory issues.

    The problem i am facing is the app is getting stuck or hung in between,that point of time the Task manager will not show any application that are being opened in the system. The moment i restore or maximise the app it will start working as exepcted.

    Any help???Here is the code i am using to destroy the icon in the tick event:
    Code:
     using (Bitmap bmp2 = new Bitmap(picGreenLight.Image))
                    {
                        using (Icon ico = System.Drawing.Icon.FromHandle(bmp2.GetHicon()))
                        {
                            this.Icon = ico;
                            System.Windows.Forms.Application.DoEvents();
                            bmp2.Dispose();
                            DestroyIcon(ico.Handle); // API to destroy the icon
                        }
                    }
    Thanks in advance.

    Regards
    Biju
  • joedeene
    Contributor
    • Jul 2008
    • 579

    #2
    Will you please take time to read the stickies at the top of the forums, specifically this forum's stickies, especially This One it says not to post questions in the Introductions forums, this is for introductions only not technical questions. Please read the Posting Guidelines, as I can see you have not used code tags[#]. This question should have probably been posted in the .Net Forum. I will inform an Admin or Moderator

    joedeene

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      You need to look in the correct tab of the TaskManager. You are only looking in the "Applicatio ns" tab, which will only list an entry for programs that have an active window with a title visible. If your form is hidden, then there is no window and the entry is not shown.
      Your program will still be listed under the "Processes" tab if you need to find it.

      Comment

      Working...