Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 868041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:04:35+00:00 2026-05-15T10:04:35+00:00

I created two application MainApps and SubApps, the SubApps has a modal type dialogbox

  • 0

I created two application MainApps and SubApps, the SubApps has a modal type dialogbox such as login/logout form etc. and its working fine.

After I attach it to the MainApps, the Modal Dialog box shows like normal box form. It behaves like “DIALOG.SHOW” instead of “DIALOG.SHOWMODAL”;

I am using delphi compiler

SubApps buttonclick;

  begin
    with TfrmDialog.Create(Self, dtLogout) do
    try
      iMsgResult := ShowModal;
    finally
      Free;
    end;
    if iMsgResult = mrOk then
    begin
      dmVoca.FHomeworkXMLDoc.Active := False;
      //Disabled Double Login
      dmVoca.tmrDoubleLogin.Enabled := False;
      ................
    end;  
  end;

MainApps ButtonClick

begin
setparent(findwindow(nil,'SubApps'),TabSheet1.Handle);
.........
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:04:35+00:00Added an answer on May 15, 2026 at 10:04 am

    Don’t be surprised, what you are trying is unusual at best. ShowModal achieves the modal effect by disabling all the windows of the calling thread but the modal form. Since your parent form do not belong to the same thread, not even to the same process, it does not get disabled. See DisableTaskWindows in forms.pas to understand how the forms are disabled when ‘ShowModal’ is called.

    You have to devise your own modal procedure; test if the application is parented in a top level window that’s not the desktop, disable that window if that’s the case.

    But if I were you I would think on the design first, what if, f.i., you close the parent form, how do you end the parented form’s process?


    edit: for 3rd comment below – you might try having the modal form “owned” by the MainApps’s form. Similiar to forms being owned by the application main form while MainFormOnTaskbar is true. See owned windows on Window Features topic of msdn.

    var
      frmDialog: TfrmDialog;
    begin
      [...]
      frmDialog := TfrmDialog.Create(Self, dtLogout);
      try
        SetWindowLong(frmDialog.Handle, GWL_HWNDPARENT, GetAncestor(Handle, GA_ROOT));
        iMsgResult := frmDialog.ShowModal;
        [...]
    

    I’d humbly suggest you to ask a question on a suggestion of a design for what you want to achieve, for instance, if it is about code reuse you could host your SubApps forms in a dll… This design is fragile, you may continue to run into problems with it…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created two forms in my Windows Application. One Form acts as a
I am trying to create a job application-form with Django. Basically, I created two
For my application, I created two JRadioButton grouped into a selection ButtonGroup . I
I have created two DbContexts, one is for application configuration, the second is for
i am new to iPad developer, i have created two or three iPad application
I have two applications Web Socket and Web Service created in .Net/Web Form and
I would like to create a UIBarButtonItem on my iPhone application which has two
I created two Spinners to display the data in my application. In my first
I have created two dictionaries in the user defaults of my application to represent
I have two different versions (Basic and Professional) of my application. I have created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.