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 8010715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:49:23+00:00 2026-06-04T18:49:23+00:00

Inside console app – GetOpenFileName() with Handle := FindWindow(Nil, Pchar(ConsoleTitle)) show OpenFile dialog modal

  • 0

Inside console app – GetOpenFileName() with Handle := FindWindow(Nil, Pchar(ConsoleTitle)) show OpenFile dialog modal to console window. Is it possible to create and show my own form modal to console window?

  • 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-06-04T18:49:24+00:00Added an answer on June 4, 2026 at 6:49 pm

    Set the console window the window owner of your form and disable it when showing your form. Something like the following:

    program Project1;
    
    {$APPTYPE CONSOLE}
    
    uses
      SysUtils,
      windows,
      forms,
      Unit1 in 'Unit1.pas' {Form1};
    
    const
      ConsoleClass = 'ConsoleWindowClass';
    
    var
      console: HWND;
      len: DWORD;
      title: array [0 .. MAX_PATH] of Char;
    
    begin
      try
        len := GetConsoleTitle(title, SizeOf(title));
        Win32Check(Bool(len));
        console := FindWindow(ConsoleClass, title);
        Win32Check(Bool(console));
        Form1 := TForm1.Create(nil);
        try
          EnableWindow(console, False);
          try
            Form1.HandleNeeded;
            SetWindowLongPtr(Form1.Handle, GWLP_HWNDPARENT, console);
            Form1.ShowModal;
          finally
            EnableWindow(console, True);
          end;
        finally
          Form1.Free;
        end;
      except
        on E:Exception do
          Writeln(E.Classname, ': ', E.Message);
      end;
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to embed a console window inside a WPF window? As a
I am trying to execute a console app with arguments inside asp.net (C#) on
i have done coding in C# but not much inside the Console App (teacher
I'm trying to host a WCF service inside a console app using Castle-Windsor 2.5
I got a small question. Say I have the following code inside a console
Having C++ console utility. The code inside parses the command line input and depending
I am trying to see from an SQL console what is inside an Oracle
When I do console.log(someobject) , I see some __proto__ object things inside my object,
My console app is executing a thread that is totally devoted to the user
I've created a simple WF4 console app and set up log4net identically to my

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.