The temporary processing method that the system dialog box (such as browsing the directory) is hidden behind the main window and the program cannot be operated

[Miscellaneous] The temporary processing method that the system dialog box (such as browsing the directory) is hidden behind the main window and the program cannot be operated

To be honest, I have been troubled by this problem for many years, and I have not found the specific reason until now. However, here is a temporary solution. Use a timer to check whether the active window of the current process is consistent with Screen.ActiveForm. If it is inconsistent, check whether Screen.ActiveForm is disabled (be careful not to look at its Enabled, but to call the API ), if it is disabled, it means that the pop-up dialog box is not a Delphi Form, we can call SetWindowPos to adjust it to the front display. The timer processing code is as follows:

This is a temporary solution for the symptoms. As for the root-cause solution, since the demo test alone cannot be reproduced in many cases, let's give it up for the time being, as a last resort...

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325119297&siteId=291194637