473,473 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Create 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:\FlowMaster 6.0\FlowCUT.exe""", AppWinStyle.NormalFocus)
AppActivate(ProcID)

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 2709
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, ChrisBettencourt!
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: 0x0000000000000000 Address: 0x000000007c80979d

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\CBETTE~1\LOCALS~1\Temp\1254_appcompat. 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 ProcessStartInfo("C:\FlowMaster 6.0\FlowCUT.exe")
MyPSI.WindowStyle = ProcessWindowStyle.Normal
MyPSI.WorkingDirectory = "C:\FlowMaster 6.0\"
Dim MyProcess As Process = Process.Start(MyPSI)
'look to see if the application is responding/open
Dim resp As Boolean
resp = MyProcess.Responding()
Do While resp = False
resp = MyProcess.Responding()
Loop
'if it is open, send the CTRL O command to choose a file
My.Computer.Keyboard.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.WindowStyle = ProcessWindowStyle.Normal to MyPSI.WindowStyle = ProcessWindowStyle.Hidden or MyPSI.WindowStyle = ProcessWindowStyle.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
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...
0
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...
0
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...
6
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...
3
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...
2
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...
12
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...
5
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: ...
23
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.