?
Solved

Running programs in background

Posted on 1998-09-15
6
Medium Priority
?
167 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
Technology Partners: 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 200 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

752 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