System dialog boxes (such as browse directories) are hidden behind the main form, resulting in temporary processing of programs that cannot be manipulated

Source: Internet
Author: User

[Talk] System dialog boxes (such as browse directories) are hidden behind the main form, causing the program to be unable to manipulate the temporary processing mode 2017-12-28? C + + Builder, Delphi, talk ? No comments? swish ? 590 views

To be honest, I have been troubled by this problem for many years, for specific reasons I have not actually found it yet. However, here is a temporary workaround, using a timer to check whether the active window of the current process is consistent with the screen.activeform, and if not, check if Screen.activeform is disabled (be careful not to look at its Enabled, but instead call API), if it is disabled, then the popup dialog box is not the Delphi Form, we call SetWindowPos to the other adjustments to the front display can be, the timer processing code reference is as follows:

delphi/pascal
12345678 procedure TForm1. Timer1timer(Sender:tobject); var atopwindow:thandle; begin atopwindow: =GetActiveWindow;   if ( Span class= "crayon-v" >atopwindow<>screen activeform. Handle and (not IsWindowEnabled< Span class= "Crayon-sy" > (screen. Activeform. Handle) then setwindowpos(atopwindow,hwnd_top,0,0,0,0, swp_nosize OR swp_nomove); end;

This temporary is a palliative approach, as to the root of the solution, because the individual set up Demo test many times can not reproduce, so temporarily give up, forced to ...

System dialog boxes (such as browse directories) are hidden behind the main form, resulting in temporary processing of programs that cannot be manipulated

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.