
Q: How can I Tell whether in Design or Runtime Mode
Quote:
: writes:
: says:
: >>
: >>Is there a way of telling which mode I am running a VB program. I want
: >>to be able to tell whether the program is running in Design mode or
: >>Runtime mode so that after shelling out, I can AppActivate either
: >>Microsost
Visual Basic or my application.
: >
: >You check whether VB.EXE is running using GetModuleUsage.
: >Another trick is then to test the existence of one of your source
: >files on its source directory. A customer would never know that!
Just because VB is running doesn't mean that the app is running under VB.
: Another way : Put a command line item in the properties dialog of Program
: Manager for VB icon. Make it a recognizable thing such as VBisrunning. If
: you are in VB then you will be able to check it using Command$. If you are
: running the executable it the Command$ returns the actual command line
: parameters(most of the time it will be empty.)
: 1. Select VB icon in program manager
: 2. Select Properties in the File menu of the PM.
: 3. In command line text box add a string. Make it like;
: C:\VB\VB.EXE VBisrunning
: ^^^^^original ^^^^^^^^added
: 4. Check the command line in your program to see if VBisrunning exists
: using Command$ statement.
Both of those ways could be easily fooled. What you do is make an EXE
with a different first 8 characters than the project. Then you can tell
which is which by the App.EXEName. The only fool-proof way is to set a
constant in your code. You have to make sure you change it when you make
the EXE.
Brad
_______________________________________________________________________
Bradley S. Murray Princeton Computer Consulting (609) 799-5300