Hi

Recently I have written my C# program to do some files checking (like house keeping).

When the program is start, it will create another threat to run at the background to check files' modified date on every 30 mins.

Most of the time the threat will go into sleep (using .WaitOne()) and wakeup every 20 seconds to do the scanning once again.

During this scanning, I have setup a simple logging feature into the threat. So every time it went into different method, it will be logged.

Also, I have use the Timer to give me display update very 1 seconds interval on the GUI (i.e. the last checking, display the file name in listbox and etc.). I did use display buffer so I can ensure that only this routine doing the display update.

Finally, I build the program to run on x86 platform.

I have carried a test run my program on my Windows 7 64-bit over 3-4 days without any problem (left the Window log-on but simply switch off my monitor). The result is predictable and no problem at all.

Then, I copy my program on to my client computer whom is running Windows Vista 32-bit and it runs as expected! But my client uses different user account, therefore she uses the "switch-user" feature to log into her own account for the daily job and let my program running at the background in different user account.

She will check my program every morning to ensure it is still doing it job but she found out that my program GUI has some strange characteristics as I will further discribe as following:

1. She can click on the program from the Taskbar to make my program back to Normal Window state from Minimise State.

2. But She can not click on any controls on my program including Minimise, Maximise, Move, Close.

3. But She can right click on the program on the Taskbar and a list of things like "Minimise, Maximise, Move, Close, Resize".

4. But non of them are clickable.

5. The program looks like no response but it doesn't show "No Response". (I can prove the program still working but the GUI isn't)

Remember I have logging feature? I went back to my log file and it is still running but the GUI doesn't update the latest information.

So, my problem are as following:

1. Why my program runs with no such problem on my machine? but it appears on my client?

a. Is it because c# don't like running at different user account? ( I have actually tested on my Windows 7 with switch-user on and problem also appear on my machine but fine if I keep log on to the account).

2. Why the GUI is not responding on either Minimise, Maximise, Close, Move, Resize and any control on my form? but my other thread is still running (proved by the log file)?

Please help me if you guys came across my problem!

Many thanks first!

Yong

Without knowing exactly what's going on, it sounds like a thread hasn't released control back to the UI. Does the thread that runs in the background interact with the UI itself? That could be a source of a deadlock.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.