473,770 Members | 4,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help Controlling external console app

I have a legacy console application that I need to
control with a c# desktop application. The main
functionality i need is the following:

Send strings
Read strings at specific locations
Send function keys (F3, F4, etc)

I have used the code from Extended Functionality for
System.Console
(http://www.gotdotnet.com/Community/U...les/Details.as
px?SampleGuid=b 76d1f08-2d79-47bd-825b-0489938aae0f) and
have been able to attach to the console application's
process using AttachConsole and GetStdHandle Win32 API
functions, but can't seem to figure out how to send
strings to the console app or read output from the app
into a string.

Can anyone help?

Thanks,
Nov 15 '05 #1
1 2305
Check out WriteConsoleInp ut/Output and ReadConsoleOutp ut/Input APIs

-vJ

"Doug Perkes" <do************ **@nospamhere.b ankofamerica.co m> wrote in
message news:00******** *************** *****@phx.gbl.. .
I have a legacy console application that I need to
control with a c# desktop application. The main
functionality i need is the following:

Send strings
Read strings at specific locations
Send function keys (F3, F4, etc)

I have used the code from Extended Functionality for
System.Console
(http://www.gotdotnet.com/Community/U...les/Details.as
px?SampleGuid=b 76d1f08-2d79-47bd-825b-0489938aae0f) and
have been able to attach to the console application's
process using AttachConsole and GetStdHandle Win32 API
functions, but can't seem to figure out how to send
strings to the console app or read output from the app
into a string.

Can anyone help?

Thanks,

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2953
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am starting is that it has a welcome window first which gets displayed and then the real windows after a while,in other words it means that the process name is the same, but the handle I need to retrive is the one from the final window and not the...
8
3232
by: Andrey Mosienko | last post by:
We are using PostgreSQL about two years beginning from version 7.0. I have one question about starting postmaster: Is there way to detach it from the controlling terminal under FreeBSD? My situation: I start postmaster manually: su pgsql -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/log/pgsql.log start" Log:
1
2133
by: cplusplusstudent | last post by:
Hello I am a new C++ programmer and am working with the Visual C++ studio. I am attempting to create a simple console application for myself but I fin that neither of the introductory C++ books I own tell me how to clear the console screen or change the font color. Is there some way to do this that could b understood by a novice programmer? Here are the three things I would like to do: Control the size of the console screen when the...
2
2128
by: Lonifasiko | last post by:
Hi group, I must launch from my Winforms application another application (.exe developed by the client) which response time sometimes can be more or less 30 seconds. I'm using ProcessManager class and WaitForExit() to start it and wait till it rsponds me. It's necessary for the application to get a response, that's why I use WaitForExit(). I don't have access to the external .exe developed by the client,
1
2319
by: =?Utf-8?B?Q3JhaWc=?= | last post by:
Hi Guys, I am trying to caputre the output for an external application. The idea is to use the System.Diagnostics.Process to run the exe in a process and redirect the output to a string. When I run the external command it works fine. But when i wrap it in a .net exe it fails to exit and the application does not exit. If I kill the external exe from task manager, the .net wrap completes.
1
1382
saranjegan
by: saranjegan | last post by:
hello, am in need to access a application when i press an external keypad (which i had connected to the serial port of the system and am recieving a value at one press of the key,i can open the port and read the value),what am need to clarify is whether there is any function exists to open the application for each press of that external key ,if not how can we implement that. secondly is there is anyway to map external keypad input to our...
4
2142
by: Joergen Bech | last post by:
Just out of curiosity: What is your favorite method of making sure that anything that happens on a form, only happens in response to a single, external event? Take the example below. I have made it as simple as I could: Put two textboxes on a form, paste the code and run it. The idea is that whatever is typed in one box is displayed in the other box, only reversed. This is a simple example of two repre- sentations of the same data on...
6
5662
by: Paulers | last post by:
Hello, I am trying to manipulate a console based application from another application for example I need to launch the console application, provide it input and take the output from the console application and use it within my application. Is this possible with vb.net? If so could someone point me in the right direction. Thank you :)
0
2127
by: Alistair George | last post by:
Hello all. I have been trying to find an api that works with external (not card) devices so that the application works with all types of product, eg all-in-one wifi/adsl/router such as Dlink dsl-g604t. A hotspot owner would like to: a) (preferably) identify the ssid of each new operative, and b) have the software enable or disable the new operative access. There is a program which does something similar which probably works on...
0
9602
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10237
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8905
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.