TurboPack / MustangpeakVirtualshellTools

Delphi and CBuilder Components to create Explorer type programs
Other
49 stars 24 forks source link

Problem with VirtualExplorerTreeview (Shellnotification Deadlock) #30

Closed RenaldoGlobe closed 1 year ago

RenaldoGlobe commented 1 year ago

Example:

  1. Use the MS Windows Explorer to create a Testfolder with some Subfolders anywhere in your directory tree.
  2. Create a new Delphi VCL project.
  3. Put a VirtualExplorerTreeview on the new TForm and set the property "ACTIVE" to true. You do not have to change any other VirtualExplorertreeview properties.
  4. Compile and start your new project.
  5. Browse with the VirtualExplorerTreeview to your recently created Testfolders.
  6. CUT one of the Subfolder via popup menu.
  7. Move (Paste) the cutted Folder via popup menu into one of the other SubFolders.
  8. You get a Deadlock. The new Application is frozen.

  9. Terminate the frozen Application with the Compiler or with the Taskmanager.

  10. Restart the Application again.
  11. Browse with the VirtualExplorerTreeview to the new Testfolders again and expand the Testfolder with Subfolders again.
  12. Additional open the MS Windows Explorer and browse to the same Testfolders.
  13. Use the MS Windows Explorer to Move one of the Subfolders into an other Subfolder.
  14. You get a Deadlock again in your Application. The Application freezes again.

If you using the copy folder funktion, everthing is ok. The problem only occurs by moving a folder.

The Mustangpeak Shellnotification has a big problem.

After investigation, I identified in the Unit "MPThreadManager.pas" the procedure "TCommonThreadManager.FlushMessageCache" The Deadlock loop begins in line 1194 : while PeekMessage(lMsg, AWindow.handle,WM_COMMONTHREADCALLBACK,WM_COMMONTHREADCALLBACK, PM_REMOVE) begin . . end in Line 1223 (end of while loop)

Maybe, this "while loop" is not the real reason for the problem, because it is called multiple times without an error. But in this particular case it will never stop.

I have no idea. I hope, you have.

Tested with Delphi 11.2, compiled as 32-Bit application, the latest release of Mustangpeak 2022.09 and the latest release of Virtualtreeview via GetIt-Package-Manager.

romankassebaum commented 1 year ago

Please try the branch "Cache". There is another condition to stop the loop.

RenaldoGlobe commented 1 year ago

Ok. You implemented a timeout counter. Very good. This works. Thank You

romankassebaum commented 1 year ago

Great to hear.