Hi guys,

I was just wondering whether it was possible to detect whether the main thread was sleeping? The reason i ask is because i have a application where the user can use keyboard short cuts to minimise the screen and close the whole application, but if the main thread is sleeping it (obviously) doesn't respond to the key pressed event until the thread is back 'awake'. Is there any way to get around this so that if the application is closed while the thread is sleeping it will close the application immediately instead of after the duration of sleep?

Thanks in advance for any help