• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

set an application like a backgroud procces

Hi Experts,

i have an application in the System Tray, and is working well, my problem is when tha application is running (every 20 minutes) the cursor change an is set like an hour glass of course. I don't want this, i wonder if exist a way to not show the hour glass cursor while the application is proccesing.

Thanks in advance. Sorry about my english.

0
Pique
Asked:
Pique
  • 5
  • 3
  • 2
1 Solution
 
PeterLarsenCommented:
Does your program show a window ?
What does the program do ?
0
 
ImagineCommented:
You have to call

application.processmessages

in your functions.
0
 
PeterLarsenCommented:
It could probably solve the problem, but it shouldn't be necessarily because the program is running in its own thread.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
PiqueAuthor Commented:
Thanks Imagine. It works and Thanks PeterLarsen i want to know what do you mean and recommend of course if you have time, any way thanks. The program upload some information to a database from plain text files every 20 minutes. Also the program could show a Window but only if you want to call the procces in then middle of the period, but most of the the time the window is hide. In the other hand i have a function to animate the icon in the tray system while the upload process is running and of course it doesn't work because the program is busy in the process. Thank you.
0
 
ImagineCommented:
No problem :-)
0
 
PeterLarsenCommented:
I need to know a few informations about your program :
How do you decide when its time to upload data - and how do you animate the icon (TTimer ?) ??
0
 
PiqueAuthor Commented:
In both cases i use TTimer.
0
 
PeterLarsenCommented:
The problem is that your update function probably run in a loop which leaves very little time to other processes e.g. changing the icon in the taskbar.

To solve this problem, your update function should run in its own thread (TThread). In the thread you must remember to use Sleep(50) or WaitForSingleObject. This will allow other processes to run smoothly.
0
 
PiqueAuthor Commented:
Thanks a lot.
0
 
PeterLarsenCommented:
thanks
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now