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

  • Home
  • SEARCH
  • 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 5967615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:58:10+00:00 2026-05-22T19:58:10+00:00

In a Delphi 7 console application, how can I check whether stdin holds a

  • 0

In a Delphi 7 console application, how can I check whether stdin holds a character, without blocking until one is entered?

My plan is that this console program will be executed by a GUI program, and its stdin will be written to by the GUI program.

So I want my console app to periodically check stdin, but I can’t find a way of doing this without blocking.

I have looked at this answer, which gets me a stream pointing to stdin, but there’s still no way to “peek” as far as I can see.

  • 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-22T19:58:11+00:00Added an answer on May 22, 2026 at 7:58 pm

    I think you have already found the right way to read stdin. It is meant to block when there’s nothing more to be read.

    The standard way to handle this is to use a separate thread to handle the pipe. When it receives new data from stdin it signals this to the processing thread, for example with a message passing mechanism.

    Having said all that, if you really want to poll you can call PeekNamedPipe to check if there is data in the pipe.

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

Sidebar

Related Questions

I have a console application written in Delphi. I saw that I can have
A Delphi console application can be run from the command line of an existing
I've written a server in Delphi 2010 that needs to launch a console application
In C++, a console application can have a message handler in its WinMain procedure,
I have written a console application in Delphi that queries information from several locations.
I have this simple console application in Delphi 2010 and I would like it
I need Crt unit for Delphi 2010 console application (ReadKey, GotoXY, ...). Is there
Simple problem in Delphi. I've created a console application and I need to change
Is there a maximum limit how long strings can be passed to Delphi console
Delphi has a $WARN compiler directive that allows one to selectively enable or disable

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.