473,386 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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:
Expand|Select|Wrap|Line Numbers
  1.  using (Bitmap bmp2 = new Bitmap(picGreenLight.Image))
  2.                 {
  3.                     using (Icon ico = System.Drawing.Icon.FromHandle(bmp2.GetHicon()))
  4.                     {
  5.                         this.Icon = ico;
  6.                         System.Windows.Forms.Application.DoEvents();
  7.                         bmp2.Dispose();
  8.                         DestroyIcon(ico.Handle); // API to destroy the icon
  9.                     }
  10.                 }
  11.  
Thanks in advance.

Regards
Biju
Oct 10 '08 #1
2 1436
joedeene
583 512MB
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
Oct 10 '08 #2
Plater
7,872 Expert 4TB
You need to look in the correct tab of the TaskManager. You are only looking in the "Applications" 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.
Oct 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jaans | last post by:
I have a problem that relates to running "cleanup" code when an application is forcibly ended using the "End Process" of "Task Manager" (Please note that this is very different from "End Task"...
6
by: rodchar | last post by:
hey all, i'm trying to use Windows' Task Manager to kick off my win form. Am I correct to say that this is not going to work because everytime it runs I see it task manager but no window ever...
4
by: Strah | last post by:
Is there a way to catch the event of terminating the application from the the processes tab in task manager? I have created windows app, and if a user termintates the app in the task manager,...
1
by: nkoranda | last post by:
I have been running into an issue that I just cant figure out. I have created an ActiveX EXE and in the Project Properties I have the Thread Model set to Thread Pool = 1. If I create an instance of...
4
by: ray well | last post by:
on my developing system, when my app exits, it always gets removed withing a second from the task manager. on my clients machine, the app exits but stays indefinitely in the task manager. i...
5
by: NEWSGROUPS | last post by:
I have some users that continuously end task on my database when a search takes to long. In turn corrupting the application. Is there any way to prevent this? The Microsoft KB for Methods That Can...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
4
by: e-Ricc | last post by:
Hi guys! Im trying to detect when a user "kills" my c# app using windows task manager, i've tried with the form events _closing and _closed managing for example putting an if inside to detect...
1
by: romcab | last post by:
Hi guys, I would like to ask your idea about my current problem. I would like to create an application which run on the background. Then when I press a certain key, the GUI of the program will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.