0
try
{
    ChangeImagePathName("explorer.exe");
    PinUnpinTaskbar(tempFilePath, true);
}
finally
{
    RestoreImagePathName();
}

Now in my code i have used this segment of code. However it is in multi-thread mode. If multi-thread execute this segment of code, my application will hang on the PinUnpinTaskbar(tempFilePath, true) function.

Is there any advice?

liping
  • 9
  • So what is this method, i have never seen it before in the whole 25 years i have been writing code – TheGeneral May 25 '18 at 04:02
  • _"Is there any advice?"_ - yes don't update the UI from a worker thread. There's a ga-zillion articles on the web –  May 25 '18 at 04:09
  • Possible duplicate of [Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on](https://stackoverflow.com/questions/142003/cross-thread-operation-not-valid-control-accessed-from-a-thread-other-than-the) –  May 25 '18 at 04:10

0 Answers0