Solved

write string to running program

Posted on 2000-02-26
6
138 Views
Last Modified: 2010-05-02
Hello Experts!!

I have a simple question;

I make use of a Windows-DOS program, and needs to send a string to that program, like "add user brian". How can I do that? I work in VB5_pro.

I expect that I have to make use of SENDKEYS, but how do I call the right program. Not shell - since I do not want to execute the program, it is already running.

Can some one help with this question?

Thank you!

/Jens*

0
Comment
Question by:Jens979
6 Comments
 

Expert Comment

by:jhedlund
ID: 2561419
Do you have access to the code of the program you wish to receive the message (the Windows/DOS one)?  If so, you could have it constantly reading a file that another one writes commands to.  Or look into DCOM.

If you do not have access to the code, you may not be able to send a message to the other program.  How does the other program work?  Command line arguments?  Can't you stop that program and reload it?
0
 
LVL 5

Accepted Solution

by:
KDivad earned 75 total points
ID: 2561460
SendKeys can't send text to a DOS window, but there is a work-around that usually works just fine.
(Note: DOS app may need to be running in a window instead of full-screen for this to work)

Try:

Appactivate Caption_Of_Window_To_Activate, True
ClipBoard.SetText Text_To_Send, vbCFText
SendKeys "% ", True
SendKeys "ep", True

Hope this helps!
0
 
LVL 1

Expert Comment

by:Maquiavelo
ID: 2561570
 Very clever KDivad!!!
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 3

Expert Comment

by:fibdev
ID: 2561684
kudos kDivad
0
 
LVL 5

Expert Comment

by:KDivad
ID: 2562285
Thanks! Let's see if Jens agrees...
0
 

Author Comment

by:Jens979
ID: 2567619
Well I could not get it working, tried a little, but then found out another way. Seems there is a commandline thing included with my server that this was for ~:\

Anyway I grade KDivad. But thanks to you all experts!

/Jens*
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now