From: BeeJ on
I would like to prevent my ActiveX EXE from starting by double-clicking
it in Windows Explorer.
Only the main app that instantiates the ActiveX EXE should do this.
How do I prevent this?
The only crude way I can think of is to start a timer in the Initialize
event and if a parameter is not set by the timeout then it is not the
main app that is starting it. But there has to be a more sophisticated
method.


From: Kevin Provance on

"BeeJ" <nospam(a)nowhere.com> wrote in message
news:i3sj2p$dh3$1(a)speranza.aioe.org...
:I would like to prevent my ActiveX EXE from starting by double-clicking
: it in Windows Explorer.
: Only the main app that instantiates the ActiveX EXE should do this.
: How do I prevent this?
: The only crude way I can think of is to start a timer in the Initialize
: event and if a parameter is not set by the timeout then it is not the
: main app that is starting it. But there has to be a more sophisticated
: method.

Under Properties>Component, what do you have "Start Mode" as? IIRC, if you
tick it to ActiveX Component, stand alone startup shouldn't be an issue.

From: BeeJ on
After serious thinking Kevin Provance wrote :
> "BeeJ" <nospam(a)nowhere.com> wrote in message
> news:i3sj2p$dh3$1(a)speranza.aioe.org...
>> I would like to prevent my ActiveX EXE from starting by double-clicking
>> it in Windows Explorer.
>> Only the main app that instantiates the ActiveX EXE should do this.
>> How do I prevent this?
>> The only crude way I can think of is to start a timer in the Initialize
>> event and if a parameter is not set by the timeout then it is not the
>> main app that is starting it. But there has to be a more sophisticated
>> method.
>
> Under Properties>Component, what do you have "Start Mode" as? IIRC, if you
> tick it to ActiveX Component, stand alone startup shouldn't be an issue.

Startup object is set to none.
Start mode is set to ActiveX component.
And yet it starts and displays a form.
I have to use Process Explorer to Kill.


From: David Youngblood on
"BeeJ" <nospam(a)nowhere.com> wrote in message
news:i3sqaq$5la$1(a)speranza.aioe.org...
> After serious thinking Kevin Provance wrote :
>> "BeeJ" <nospam(a)nowhere.com> wrote in message
>> news:i3sj2p$dh3$1(a)speranza.aioe.org...
>>> I would like to prevent my ActiveX EXE from starting by double-clicking
>>> it in Windows Explorer.
>>> Only the main app that instantiates the ActiveX EXE should do this.
>>> How do I prevent this?
>>> The only crude way I can think of is to start a timer in the Initialize
>>> event and if a parameter is not set by the timeout then it is not the
>>> main app that is starting it. But there has to be a more sophisticated
>>> method.
>>
>> Under Properties>Component, what do you have "Start Mode" as? IIRC, if
>> you tick it to ActiveX Component, stand alone startup shouldn't be an
>> issue.
>
> Startup object is set to none.
> Start mode is set to ActiveX component.
> And yet it starts and displays a form.
> I have to use Process Explorer to Kill.

Can you post some example code that demonstrates that?

David


From: Dee Earley on
On 10/08/2010 23:15, BeeJ wrote:
> I would like to prevent my ActiveX EXE from starting by double-clicking
> it in Windows Explorer.
> Only the main app that instantiates the ActiveX EXE should do this.
> How do I prevent this?
> The only crude way I can think of is to start a timer in the Initialize
> event and if a parameter is not set by the timeout then it is not the
> main app that is starting it. But there has to be a more sophisticated
> method.

It will exit immediately unless you do something in the Sub Main.
If you want to show a message, and exit, do something like:
If App.StartMode = vbSModeStandalone Then
MsgBox "This can not be run standalone"
End If

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)