473,796 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open and operate an external application

2 New Member
Hello,

I'm a super fresh newbie to VB, and I'd really appreciate any help!

My current issue is that I'm trying to open an application using:
Dim ProcID As Integer
ProcID = Shell("""C:\Flo wMaster 6.0\FlowCUT.exe """, AppWinStyle.Nor malFocus)
AppActivate(Pro cID)

I got this code from the help file. I've just put it in a button, and when I click it, I see the splash screen for the program, but then I get an error.


That is my problem in the short term. In the long term, my ultimate goal is to create an interface for this existing program named FlowCUT that would limit the options avaliable to the user. (So the user would only be able to view the CAD image, and begin the cutting procedure, but they could not modify any specs) My plan is to just have a small app that operates the program, but keeps it hidden somehow, and just has less buttons, etc, but is taking all info from FlowCUT. If there is a better way to do this, I'd love to hear about it.

Thanks in advance.
May 18 '07 #1
3 2725
Dököll
2,364 Recognized Expert Top Contributor
Hello,

I'm a super fresh newbie to VB, and I'd really appreciate any help!

My current issue is that I'm trying to open an application using:
Expand|Select|Wrap|Line Numbers
  1.  
  2.         Dim ProcID As Integer
  3.         ProcID = Shell("""C:\FlowMaster 6.0\FlowCUT.exe""",  AppWinStyle.NormalFocus)
  4.         AppActivate(ProcID)
  5.  
  6.  
I got this code from the help file. I've just put it in a button, and when I click it, I see the splash screen for the program, but then I get an error.

Thanks in advance.
What is the error you are getting, ChrisBettencour t!
May 19 '07 #2
ChrisBettencourt
2 New Member
Whoops! I guess that would be helpful to expalin.

It shows the splash screen, and then just says that FlowCUT has encountered a problem and needs to close. When I click on the More Information link, it tells me:
AppName:flowcut .exe AppVer:6.0.2.0 ModName: kernel32.dll
ModVer: 5.1.2600.2180 Offset: 0000979d

When I click on the Technical Information link, I get all sorts of stuff.
Exception Information
Code: 0xc0000005 Flags: 0x00000000
Record: 0x0000000000000 000 Address: 0x000000007c809 79d

followed by pages and pages of similar stuff.
At the bottom half of the window, it says

The following files will be included in this error report:
C:\DOCUME~1\CBE TTE~1\LOCALS~1\ Temp\1254_appco mpat.txt

(This file does not seem to exist when I look for it.)
So I tried using a different method:


'Start the FlowCUT application
Dim MyPSI As New ProcessStartInf o("C:\FlowMaste r 6.0\FlowCUT.exe ")
MyPSI.WindowSty le = ProcessWindowSt yle.Normal
MyPSI.WorkingDi rectory = "C:\FlowMas ter 6.0\"
Dim MyProcess As Process = Process.Start(M yPSI)
'look to see if the application is responding/open
Dim resp As Boolean
resp = MyProcess.Respo nding()
Do While resp = False
resp = MyProcess.Respo nding()
Loop
'if it is open, send the CTRL O command to choose a file
My.Computer.Key board.SendKeys( "^o")

and it opens the application just fine, but the .SendKeys() function does not work. There is no error message, it just fails to do anything.

also, when I change MyPSI.WindowSty le = ProcessWindowSt yle.Normal to MyPSI.WindowSty le = ProcessWindowSt yle.Hidden or MyPSI.WindowSty le = ProcessWindowSt yle.Minimized, there is no change. That applies to the first code I was using as well. No matter what I do, all applications open as being 'Normal'.

so I guess my two main problems right now are getting SendKeys() to work, and getting the window to be hidden somehow at some point.
May 21 '07 #3
Killer42
8,435 Recognized Expert Expert
It might be worth testing what happens if you create a shortcut to the FlowCUT program, and set the shortcut properties to start minimised. If this doesn't work, then I doubt your program will have much success doing it either.

Of course, your two goal are to some extent mutually exclusive. To receive the sent keys it will need to have the focus, so minimising it may (or may not) preclude this. I suppose the window state (normal, minimised etc) isn't really critical, as long as it has the focus.

It would make things a heck of a lot easier if FlowCUT provides some sort of automation interface. Then you could bypass its user interface entirely and just drive it from your code.

Does FlowCUT provide any other sort of automation options, such as taking commands from an input file? If so, you might be able to take advantage of that.

Oh, and one other thing - what version of VB are you using?
May 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
10392
by: Kathy Benson | last post by:
Hi, I need to open an external file, such as *.htm from a Java program. I need to open this file by the default program that handles this extension on the machine. So *.htm should always be opened by Netscape if that is the default browser on the machine. I figured out how to do this on NT but could not find an equivalent command on Linux. Here is what I did on NT.
0
1393
by: Guy | last post by:
Please email your resume if you are interested in this position in Harrisburg, PA. Candidate will consolidate state agency mission-critical systems that citizens of Pennsylvania depend on every day into one centralized, "always open" data center. The Commonwealth of Pennsylvania partnered with Unisys to consolidate agencies and develop a state-of-the-art Data PowerHouse supported 24 hours a day, 7 days a week, 365 days a year. As this...
0
2438
by: J Wilks | last post by:
I am trying to download an XML file via Internet Explorer and view it in an external application. The file has a KML extension, which is registered in Windows file types to my external viewer. So I type the following into the browser: http://localhost/test/myfile.kml And IE displays the XML, instead of launching it in my external viewer! I can get around this by having the web server drop a
6
12178
by: lukeo | last post by:
I'm shelling out to an .asp (or htm) page from an application. I want to show this in a window without the address bar, etc... Is there a way I can redirect this page using javascript to a page where I can set the window height, statusbar=no, etc? Thanks, -Luke
3
2763
by: justin.vanwinkle | last post by:
Hello everyone, I need some tar functionality for my program. Currently the following code properly displays tar archives, and tar.gz archives. However, it chokes on tar.bz2 archives with the following error: File "mail_filter.py", line 262, in extract_archive tar_archive = tarfile.open('', 'r', fileobj) File "/usr/lib/python2.3/tarfile.py", line 900, in open return func(name, "r", fileobj)
2
1136
by: Ronald S. Cook | last post by:
I have a VB.NET Win app wherein I would like to (via code) open another application window external to my app's window and set the position and size on the user's screen. I would greatly appreciate any response/help. Thanks, Ron
12
6254
by: Steve | last post by:
I have a database that raises an error when you try to open it and it doesn't open. Trying to open the database with the OpenDatabase method raises the same error. Trying to import any objects (tables, queies, forms, etc) from the database raises the same error. Trying to link to the tables in the database raises the same error. I am guessing there is an autoexec macro or code in the open event of the opening form that contains the error....
5
9470
by: Ian | last post by:
I am trying to: 1. Open a form on the external database 2. Enter a value in a text box on that form I have 1 above working OK using module form “The Access Web”, the module looks like this: ************ Code Start ************* ' This code was originally written by Dev Ashish.
23
5979
by: andyoye | last post by:
How can I launch Outlook on users machines when they click a button on a web form (InfoPath)? Thanks
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5453
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4127
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.