[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Running programs in background

Posted on 1998-09-15
6
Medium Priority
?
168 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

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!

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…
Suggested Courses

650 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