Solved

Running programs in background

Posted on 1998-09-15
6
162 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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 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…

914 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