Multiple Delphi Applications and Dialogs

I have a Delphi 7 application that has two document views (for example, editing HTML WYSIWYG may look like WYSIWYG and the original view, and not my real application). They can be opened in separate windows or docked with tabs in the main window.

If I open a modal dialog box from one of the separate forms, the main form is brought to the fore and displayed as the selected window on the Windows taskbar. Say the main form is the WYSIWYG view, and the original view opens. You go to a specific point in the original view and insert the image tag. A dialog box appears allowing you to select and enter the properties that you want for the image. If the WYSIWYG view and the original view overlap, the WYSIWYG view will be brought to the foreground and the source view will be hidden. When the dialogue deviates, the original view returns to the field of view.

I tried to set the owner and ParentWindow properties in the form with which it is associated:

dialog := TDialogForm.Create( parentForm );
dialog.ParentWindow := parentForm.Handle;

How can I fix this problem? What else should I try?

Given that people seem to stumble over my example, perhaps I can try with a better example: a text editor that allows you to open more than one file at a time. Open files are either in the form of tabs (for example, in the Delphi IDE), or in a separate window. Suppose a user opens a spellcheck dialog or a search dialog. What happens is that if the file is edited in its own window, this window is sent below the main form in z-order when a modal dialog box is displayed; as soon as the dialog is closed, it returns to the original z-order.

Note . If you are using Delphi 7 and are looking for a solution to this problem, see my answer below on the page to find out what I did.

+4
5

... ( , )

dialog := TDialogForm.Create( parentForm );
dialog.PopupParent := parentForm;
dialog.PopupMode   := pmExplicit; 
dialog.ShowModal();
+5

answer Google. , :


procedure TDialogForm.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.Style := Params.Style or WS_POPUP;
  Params.WndParent := (Owner as TWinControl).Handle;
end;

, Delphi 7.

+3

ShowModal Show? , PopupMode . pmAuto, , . , PopupParent.

+1

, , , , , . , , , .

-, , Create ( ). , , , "", . WYSIWYG?

0

, , , , , ...

  • Delphi. , , Windows Vista Delphi 2007.
  • Delphi 2007, , Application.MainFormOnTaskBar.
  • Form BringToFront/SendToBack Z-, .

, , , , , , , !

0

All Articles