Solved

Running programs in background

Posted on 1998-09-15
6
165 Views
Last Modified: 2010-04-30
I have written a VB5 (WIN32) program that uses a shell command to open a copy of IBM Persnonal Communication/3270.  I access 3270 to copy the total parts we have shipped to the clipboard.  I then set a variable to the clipboard text.  I then send the clipboard text to a display screen we have using MSCOMM.  I can get the program to work.  The program cycles every 5 minutes to get the newest text from the clipboard.  Here is the problem: the program runs on a supervisor's computer and I want to be able to have it run in the background without the supervisor even knowing it.  Right now the program calls up 3270, makes it the focus and gets the number.  If I try to use the computer while the program is running it crashes.  Anyone have any ideas, or do you need more information.  
0
Comment
Question by:gerime
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1435040
Have you tried:
lRes = Shell("My3270App.exe", vbHide)

I can't say I'm comfortable with using the clipboard while a user is (or may be) running another app.  What happens if, in between the 5 minute period, the user copies something else to the clipboard?
Personally, if you must go this route, I would suggest you write to and read from a file.  (DDE would be better, but not always possible)
0
 

Author Comment

by:gerime
ID: 1435041
I have tried vbHide, to no avail.  I know it would be best to use DDE but it is not possible in this situation.  I have been up to our IT guys and and even they know no other way than to use cut and paste.  The clipboard is a problem.  If someone cuts and pastes while the program is running it will put something else in the clipboard.  What I have done is make sure that if the text is not a number, than use the old number.  The program also cycles every 5 minutes so in that short amount of time, we will get the newest number anyway.  

BELIEVE ME, I WISH DDE WAS POSSIBLE.
0
 
LVL 1

Expert Comment

by:jadefire98
ID: 1435042
I know that this would be the hard way to do it but could you us API commands to do all the memory alocation and then you would have your own version of a clipboad working for you and that way you would not mess with the system clipboard on top of that there would be nothing to crash except your program which would at least not crash your computer! Just a thought!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:gerime
ID: 1435043
Did not work
0
 
LVL 15

Expert Comment

by:ameba
ID: 1435044
Are you grabing text from a textbox in one application? Or combobox, or anything with hwnd?
If you are, you can use GetWindowText function.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1435045
Use the findwindow api to find the window to which you want to communicate. Now use SetWindowText to put in the information that you want to transfer.

I can give you more information if you want to.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 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