Lazarus

Free Pascal => General => Topic started by: iruanpan on May 24, 2022, 02:20:06 am

Title: Questions about input and output pipe in Lazarus TProcess
Post by: iruanpan on May 24, 2022, 02:20:06 am
I would like to make a terminal with a Lazarus GUI application. But I'm in trouble. And I hope someone can help me, please.


Question1 was solved with encoding.
Question1: The Chinese and other special chars cannot display normally, I would like to know how to fix this problem.

(code)Class of the thread and "run" button on click event: https://i.stack.imgur.com/ZObEW.png

screenshot: https://i.stack.imgur.com/pymqT.png


Question2: I want to know how to input some command into the console. For example, I would like to start a Minecraft server, and execute a command in the console with TProcess. I tried to start a Windows cmd, and use "ver" command. But when I click the button, nothing happened.

The send command button: https://i.stack.imgur.com/ZfZfC.png

The write function returns 0.
Title: Re: Questions about input and output pipe in Lazarus TProcess
Post by: marcov on May 26, 2022, 08:49:18 pm
I have this project as an interactive test of tprocess:

http://www.stack.nl/~marcov/files/processmemodemo.zip

instructions: 

I hope it helps you in your direction.
TinyPortal © 2005-2018