main thread is lagging...
Posted on 2004-11-27
I have a generic question for you. I recently set up a timer to capture my desktop and then outout it to a file, and in the same procuedure I'm also converting the old format to a newer format then deleting the old formatted file. This heavily weighs down my main VCL thread and I've tried both the sleep function and have even written a delay function using MsgWaitForMultipleObjects. Both seem to not help a whole lot and I was wondering if I should consider possibly creating a seperate thread after the screen capture is taken then add the convert function and delete function in the execution section of the newly created thread? Do you think this would help in solving this system lag? The mouse cursor doesnt skip a beat, but when you're typing for example it halts the keys for a brief number of milliseconds, sometimes even for a second or more. Application.ProcessMessages() doesn't seem to solve it either.
I'm open to any coding ideas or suggestions.