Sleeping NotifyIcon Thread locks up explorer.exe

  • Thread starter Thread starter Nico De Greef
  • Start date Start date
N

Nico De Greef

Hi,

Create a windows form and run the following code from a button:
notifyIcon1.Visible = true;
System.Threading.Thread.Sleep(15000);

Click the button.
Try to access your windows explorer via the [WindowsKey]-E shortcut. This
will not work, at this point the taskbar will freeze to.
After the sleep time of, in this case, 15 seconds, the requested windows
explorer will pop up.

Anyone has a workaround or explanation for this behaviour ?

Best regards;
 
I don't, it's just an example.
The code is used in a console application: Change the notify icon and sleep
for 15 seconds.

Ollie Riches said:
Why would you ever want to block the UI thread?

Ollie Riches

Nico De Greef said:
Hi,

Create a windows form and run the following code from a button:
notifyIcon1.Visible = true;
System.Threading.Thread.Sleep(15000);

Click the button.
Try to access your windows explorer via the [WindowsKey]-E shortcut. This
will not work, at this point the taskbar will freeze to.
After the sleep time of, in this case, 15 seconds, the requested windows
explorer will pop up.

Anyone has a workaround or explanation for this behaviour ?

Best regards;
 
Back
Top