[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

Message Detached With Timeout

BeeJ

6/4/2012 9:29:00 PM

When my app closes I want to launch a self-closing "messagebox".

How it would work.
When my app is unloading this "messagebox" is launched.
Has a message. One line (multi-line optional)
Has a caption (optional)
Has an OK (or close) button (optional or no button)
My app closes entirely.
The messagebox stays open for a preprogrammed time, say 5 seconds then
closes.
The messagebox does nothing more than display a message "after" my app
closes. There is no response (e.g. OK button) from the messagebox to
anything.
I want to run only a Windows thing to display the message.

How can this be done?

I have been playing with
Private Declare Function MessageBoxTimeout Lib "user32.dll" Alias
"MessageBoxTimeoutA" ( _
ByVal hwnd As Long, _
ByVal lpText As String, _
ByVal lpCaption As String, _
ByVal uType As Long, _
ByVal wLanguageId As Long, _
ByVal dwMilliseconds As Long _
) As Long

but I see no way to detach that from my app since my app will not be
running after this message box is started (as I need it).

--
So where are we?
Not the street address.
Not the city.
Not the country.
Not the Earth.
Not the Solar System.
Not the Galaxy.
Not the Universe.
Not the Brane.
So where is the Brane?
Where are we?

Life is but a dream!


19 Answers

MikeB

6/4/2012 9:36:00 PM

0

Just use an HTA. You can store the HTA description in your app and launch
it on close. The HTA can have a timer to close itself or accept a button
press by the user. Mayayana can chime in here with respect to it being able
to delete itself after use (never tried it, so....)

"BeeJ" <nospam@spamnot.com> wrote in message
news:jqj9av$q4h$1@speranza.aioe.org...
> When my app closes I want to launch a self-closing "messagebox".
>
> How it would work.
> When my app is unloading this "messagebox" is launched.
> Has a message. One line (multi-line optional)
> Has a caption (optional)
> Has an OK (or close) button (optional or no button)
> My app closes entirely.
> The messagebox stays open for a preprogrammed time, say 5 seconds then
> closes.
> The messagebox does nothing more than display a message "after" my app
> closes. There is no response (e.g. OK button) from the messagebox to
> anything.
> I want to run only a Windows thing to display the message.
>
> How can this be done?
>
> I have been playing with
> Private Declare Function MessageBoxTimeout Lib "user32.dll" Alias
> "MessageBoxTimeoutA" ( _
> ByVal hwnd As Long, _
> ByVal lpText As String, _
> ByVal lpCaption As String, _
> ByVal uType As Long, _
> ByVal wLanguageId As Long, _
> ByVal dwMilliseconds As Long _
> ) As Long
>
> but I see no way to detach that from my app since my app will not be
> running after this message box is started (as I need it).
>
> --
> So where are we?
> Not the street address.
> Not the city.
> Not the country.
> Not the Earth.
> Not the Solar System.
> Not the Galaxy.
> Not the Universe.
> Not the Brane.
> So where is the Brane?
> Where are we?
>
> Life is but a dream!
>
>


Karl E. Peterson

6/4/2012 9:40:00 PM

0

BeeJ was thinking very hard :
> but I see no way to detach that from my app since my app will not be running
> after this message box is started (as I need it).

If you want a different process ("detach from my app"), then it must be
another process. Not sure what part of that truth you're stumbling on?

--
..NET: It's About Trust!
http://vfre...


BeeJ

6/4/2012 9:55:00 PM

0

RE: HTA
I saw some sample code out there but when I tried it it was incomplete
with a call to
Window
whatever that is.
It crashed with an IE full screen and no way to easily close (no
caption bar).
Even Process Explorer had a tough time closing it.

--
So where are we?
Not the street address.
Not the city.
Not the country.
Not the Earth.
Not the Solar System.
Not the Galaxy.
Not the Universe.
Not the Brane.
So where is the Brane?
Where are we?

Life is but a dream!


BeeJ

6/4/2012 10:32:00 PM

0

From what I have seen the HTA needs to run VBScript to do the timeout.
i.e. there is no HTML to do a timeout.
Is that correct?

--
So where are we?
Not the street address.
Not the city.
Not the country.
Not the Earth.
Not the Solar System.
Not the Galaxy.
Not the Universe.
Not the Brane.
So where is the Brane?
Where are we?

Life is but a dream!


MikeB

6/4/2012 10:43:00 PM

0

Baloney..
I use them for adhoc db reports when I output as HTML to file, I just
rename it to *.HTA and it appears like magic. And it couldn't crash with a
full IE screen because all the IE is stripped from the MSHTA.EXE that
supports it.

Try a little harder.


"BeeJ" <nospam@spamnot.com> wrote in message
news:jqjaqi$u6a$1@speranza.aioe.org...
> RE: HTA
> I saw some sample code out there but when I tried it it was incomplete
> with a call to
> Window
> whatever that is.
> It crashed with an IE full screen and no way to easily close (no caption
> bar).
> Even Process Explorer had a tough time closing it.
>
> --
> So where are we?
> Not the street address.
> Not the city.
> Not the country.
> Not the Earth.
> Not the Solar System.
> Not the Galaxy.
> Not the Universe.
> Not the Brane.
> So where is the Brane?
> Where are we?
>
> Life is but a dream!
>
>


MikeB

6/4/2012 10:48:00 PM

0

HTA works happily with JScript or JavaScript and can work in combination
with VBScript without complaint. Very flexible.




"BeeJ" <nospam@spamnot.com> wrote in message
news:jqjd0u$3tu$1@speranza.aioe.org...
> From what I have seen the HTA needs to run VBScript to do the timeout.
> i.e. there is no HTML to do a timeout.
> Is that correct?
>
> --
> So where are we?
> Not the street address.
> Not the city.
> Not the country.
> Not the Earth.
> Not the Solar System.
> Not the Galaxy.
> Not the Universe.
> Not the Brane.
> So where is the Brane?
> Where are we?
>
> Life is but a dream!
>
>


BeeJ

6/4/2012 10:55:00 PM

0

It seems that to create an HTA with a timeout it then needs either Java
Script or VBScript. But that means that if the PC has had those
disabled then the HTA will not do what I want, correct?
Since I am not in control of that aspect maybe HTA will not work
universally.
Samples I have worked with so far use VBScript.

--
Present and unaccounted for.


Karl E. Peterson

6/4/2012 10:57:00 PM

0

BeeJ explained :
> It seems that to create an HTA with a timeout it then needs either Java
> Script or VBScript. But that means that if the PC has had those disabled
> then the HTA will not do what I want, correct?
> Since I am not in control of that aspect maybe HTA will not work universally.
> Samples I have worked with so far use VBScript.

Still ignoring my obvious answer, aren't you? Classic...

--
..NET: It's About Trust!
http://vfre...


BeeJ

6/4/2012 11:49:00 PM

0

What part of

I want to run only a Windows thing to display the message.

did you not get?

i.e. i do not want to write an VB6 message box .exe that I have to
embed into the main app then write it out and shell to it. Although I
know how to do that, that is not what I want.

The HTA seem interesting but the viability of scripting is in question
on the various PCs that the app may be deployed on.

So what Windows app can I shell to to put up a message that will
automatically time out and close itself?

--
Present and unaccounted for.


Norm

6/5/2012 2:10:00 AM

0

Karl E. Peterson brought next idea :
> BeeJ was thinking very hard :
>> but I see no way to detach that from my app since my app will not be
>> running after this message box is started (as I need it).
>
> If you want a different process ("detach from my app"), then it must be
> another process. Not sure what part of that truth you're stumbling on?

It seems to me that if you just want to display a message for a short
time, before your app closes, you could use a timed message box and
when it closes your app will close and exit. Is this not what you are
trying to do?

Take a look at the code here.

http://www.freevbcode.com/ShowCode.a...

Norm