novice123
March 18th, 2006, 12:26 PM
Hi,
I have multi-thread program as a console application. The program runs fine as it is. But i am trying to convert it to windows application with system tray icon so that in the system tray i have an icon and i will be able start and stop gracefully.
I am able to start the program with threads, but when i want to stop the program , i cannot do it. After the program has started i am unable to right click on the tray-icon, so that i can stop.
Currently in Console application i have 5 threads.
1. Main-thread . Main thread starts 2 threads, threadFunc1 and threadFunc2 . These 2 threads one thread each for processing.
I guess when i trying to stop, i don't know which thread is active. I tried ExitThread -- which would basically kill every thing, but this does not seem to work.
I tried TerminateThread, terminating each thread , but even that does not help.
Can some one has done this similar stuff, before can you please throw some light.
I am using Create thread for creating threads. Do i need to change the CreateThread to AfxBeginThread ?
Any help is appreciated and thanks in advance....
thank you
I have multi-thread program as a console application. The program runs fine as it is. But i am trying to convert it to windows application with system tray icon so that in the system tray i have an icon and i will be able start and stop gracefully.
I am able to start the program with threads, but when i want to stop the program , i cannot do it. After the program has started i am unable to right click on the tray-icon, so that i can stop.
Currently in Console application i have 5 threads.
1. Main-thread . Main thread starts 2 threads, threadFunc1 and threadFunc2 . These 2 threads one thread each for processing.
I guess when i trying to stop, i don't know which thread is active. I tried ExitThread -- which would basically kill every thing, but this does not seem to work.
I tried TerminateThread, terminating each thread , but even that does not help.
Can some one has done this similar stuff, before can you please throw some light.
I am using Create thread for creating threads. Do i need to change the CreateThread to AfxBeginThread ?
Any help is appreciated and thanks in advance....
thank you