Solved

Running programs in background

Posted on 1998-09-15
6
161 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
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

15 Experts available now in Live!

Get 1:1 Help Now