[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.vb.general.discussion

Closing Grouped instances in the taskbar

Sneha Menon

9/1/2010 5:52:00 PM

Hi All

VB6 Application. If there are a number of instances of the application
running, and they are grouped in the taskbar, how can I close all
instances by clicking 'Close Group' ? What shall I do in my vb6
application to make it respond to the windows 'Close Group' ? (OS is
windows XP)

Thanks.

Sneha
15 Answers

ralph

9/1/2010 6:51:00 PM

0

On Wed, 1 Sep 2010 10:51:59 -0700 (PDT), Sneha Menon
<spiderangelo@gmail.com> wrote:

>Hi All
>
>VB6 Application. If there are a number of instances of the application
>running, and they are grouped in the taskbar, how can I close all
>instances by clicking 'Close Group' ? What shall I do in my vb6
>application to make it respond to the windows 'Close Group' ? (OS is
>windows XP)
>

Have you defined a QueryUnload Event?

Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
On Error Resume Next
'UnloadMode possibilities:
'0 The user has chosen the Close command from the Control-menu
box on the form.
'1 The Unload method has been invoked from code.
'2 The current Windows-environment session is ending.
'3 The Microsoft Windows Task Manager is closing the
application.
'4 An MDI child form is closing because the MDI form is closing.

' insert what ever you want to check here
' for example, if unsaved data
If globalDirtyFlag Then
Cancel = True
End If
' or most often used to catch the 'close command'
If UnloadMode <> 1 Then
Cancel = True
' free to continue with program
End If
End Sub

Karl E. Peterson

9/1/2010 9:18:00 PM

0

Sneha Menon formulated on Wednesday :
> VB6 Application. If there are a number of instances of the application
> running, and they are grouped in the taskbar, how can I close all
> instances by clicking 'Close Group' ? What shall I do in my vb6
> application to make it respond to the windows 'Close Group' ? (OS is
> windows XP)

Almost certainly, nothing. Windows will just attempt to "close
nicely", presumably by sending WM_CLOSE to the top-level window, all
apps in that group.

Yep, just tested in both Win7x64 and XP. You treat "Close Group"
absolutely no differently than you do "Close".

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


ralph

9/1/2010 10:47:00 PM

0

On Wed, 01 Sep 2010 14:17:37 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:

>Sneha Menon formulated on Wednesday :
>> VB6 Application. If there are a number of instances of the application
>> running, and they are grouped in the taskbar, how can I close all
>> instances by clicking 'Close Group' ? What shall I do in my vb6
>> application to make it respond to the windows 'Close Group' ? (OS is
>> windows XP)
>
>Almost certainly, nothing. Windows will just attempt to "close
>nicely", presumably by sending WM_CLOSE to the top-level window, all
>apps in that group.
>
>Yep, just tested in both Win7x64 and XP. You treat "Close Group"
>absolutely no differently than you do "Close".

That's why I suggested the QueryUnload ... my guess is the OP is
capturing the WM_CLOSE somewhere.

I've done that before. Get so involved in making sure a user has only
"one way out" or keeping a resource alive, I forget there may be times
you want to let the O/S close it. <g>

-ralph

Karl E. Peterson

9/1/2010 11:01:00 PM

0

ralph explained on 9/1/2010 :
> On Wed, 01 Sep 2010 14:17:37 -0700, Karl E. Peterson <karl@exmvps.org>
> wrote:
>
>> Sneha Menon formulated on Wednesday :
>>> VB6 Application. If there are a number of instances of the application
>>> running, and they are grouped in the taskbar, how can I close all
>>> instances by clicking 'Close Group' ? What shall I do in my vb6
>>> application to make it respond to the windows 'Close Group' ? (OS is
>>> windows XP)
>>
>> Almost certainly, nothing. Windows will just attempt to "close
>> nicely", presumably by sending WM_CLOSE to the top-level window, all
>> apps in that group.
>>
>> Yep, just tested in both Win7x64 and XP. You treat "Close Group"
>> absolutely no differently than you do "Close".
>
> That's why I suggested the QueryUnload ... my guess is the OP is
> capturing the WM_CLOSE somewhere.

Yeah, I'd hoped to imply that with the last sentence.

> I've done that before. Get so involved in making sure a user has only
> "one way out" or keeping a resource alive, I forget there may be times
> you want to let the O/S close it. <g>

Oops. <g>

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


Sneha Menon

9/2/2010 12:08:00 AM

0


> Almost certainly, nothing.  Windows will just attempt to "close
> nicely", presumably by sending WM_CLOSE to the top-level window, all
> apps in that group.

That's what I had thought. And, as almost all the projects I had
handled was single instance ones I hadn't done any research into it.

But One of my applications(a custom browser, Multiple instances of
it), it is not responding to 'Close Group' calls. Nothing happens when
I click 'Close Group'

The application does not have a mdi form.
The Main form does not have a conventional title bar. An activeX
component (w/ icon, caption, min button, close button, customizable
gradient BG) serve as the title bar.
No any code in QueryUnload event.

What could be the possible reasons? Ralph was mentioning queryunload,
but I could not see anything in the post addressing the 'close group'
issue. Is there anything I can do in the QueryUnload to make the
application close all its instances?

Sneha

Karl E. Peterson

9/2/2010 1:05:00 AM

0

Sneha Menon pretended :
>> Almost certainly, nothing.  Windows will just attempt to "close
>> nicely", presumably by sending WM_CLOSE to the top-level window, all
>> apps in that group.
>
> That's what I had thought. And, as almost all the projects I had
> handled was single instance ones I hadn't done any research into it.
>
> But One of my applications(a custom browser, Multiple instances of
> it), it is not responding to 'Close Group' calls. Nothing happens when
> I click 'Close Group'
>
> The application does not have a mdi form.
> The Main form does not have a conventional title bar. An activeX
> component (w/ icon, caption, min button, close button, customizable
> gradient BG) serve as the title bar.
> No any code in QueryUnload event.
>
> What could be the possible reasons? Ralph was mentioning queryunload,
> but I could not see anything in the post addressing the 'close group'
> issue. Is there anything I can do in the QueryUnload to make the
> application close all its instances?

Well, you could certianly try it, but given you don't have a standard
titlebar I'm starting to suspect that your app isn't processing
WM_CLOSE at all. What happens when you have a single instance, and
just select "Close" from the right-click on the taskbar menu?

Since you've chosen to use a non-standard UI, odds are you're going to
need to do some message sniffing with Spy++ and probably subclass the
hidden top-level window watching for WM_CLOSE. But your use of the 3rd
party tool really means only you can troubleshoot this one.

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


(nobody)

9/2/2010 1:21:00 AM

0

I think in your case, with somewhat non-standard window, Windows or Explorer
is confused about which window is the main application window, so it
couldn't find it. Try adding a regular form, and make it invisible, then see
if QueryUnload is called.

"Sneha Menon" <spiderangelo@gmail.com> wrote in message
news:51821be3-34bd-4b56-b9c3-cd6e5194254c@q21g2000prm.googlegroups.com...

> Almost certainly, nothing. Windows will just attempt to "close
> nicely", presumably by sending WM_CLOSE to the top-level window, all
> apps in that group.

That's what I had thought. And, as almost all the projects I had
handled was single instance ones I hadn't done any research into it.

But One of my applications(a custom browser, Multiple instances of
it), it is not responding to 'Close Group' calls. Nothing happens when
I click 'Close Group'

The application does not have a mdi form.
The Main form does not have a conventional title bar. An activeX
component (w/ icon, caption, min button, close button, customizable
gradient BG) serve as the title bar.
No any code in QueryUnload event.

What could be the possible reasons? Ralph was mentioning queryunload,
but I could not see anything in the post addressing the 'close group'
issue. Is there anything I can do in the QueryUnload to make the
application close all its instances?

Sneha


ralph

9/2/2010 3:18:00 AM

0

On Wed, 01 Sep 2010 18:05:27 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:

>Sneha Menon pretended :
>>> Almost certainly, nothing.  Windows will just attempt to "close
>>> nicely", presumably by sending WM_CLOSE to the top-level window, all
>>> apps in that group.
>>
>> That's what I had thought. And, as almost all the projects I had
>> handled was single instance ones I hadn't done any research into it.
>>
>> But One of my applications(a custom browser, Multiple instances of
>> it), it is not responding to 'Close Group' calls. Nothing happens when
>> I click 'Close Group'
>>
>> The application does not have a mdi form.
>> The Main form does not have a conventional title bar. An activeX
>> component (w/ icon, caption, min button, close button, customizable
>> gradient BG) serve as the title bar.
>> No any code in QueryUnload event.
>>
>> What could be the possible reasons? Ralph was mentioning queryunload,
>> but I could not see anything in the post addressing the 'close group'
>> issue. Is there anything I can do in the QueryUnload to make the
>> application close all its instances?
>
>Well, you could certianly try it, but given you don't have a standard
>titlebar I'm starting to suspect that your app isn't processing
>WM_CLOSE at all. What happens when you have a single instance, and
>just select "Close" from the right-click on the taskbar menu?
>
>Since you've chosen to use a non-standard UI, odds are you're going to
>need to do some message sniffing with Spy++ and probably subclass the
>hidden top-level window watching for WM_CLOSE. But your use of the 3rd
>party tool really means only you can troubleshoot this one.

Why is all the really interesting information always so late in
coming?

-ralph
<g>

Karl E. Peterson

9/2/2010 5:38:00 PM

0

After serious thinking ralph wrote :
> On Wed, 01 Sep 2010 18:05:27 -0700, Karl E. Peterson <karl@exmvps.org>
> wrote:
>
>> Sneha Menon pretended :
>>>> Almost certainly, nothing.  Windows will just attempt to "close
>>>> nicely", presumably by sending WM_CLOSE to the top-level window, all
>>>> apps in that group.
>>>
>>> That's what I had thought. And, as almost all the projects I had
>>> handled was single instance ones I hadn't done any research into it.
>>>
>>> But One of my applications(a custom browser, Multiple instances of
>>> it), it is not responding to 'Close Group' calls. Nothing happens when
>>> I click 'Close Group'
>>>
>>> The application does not have a mdi form.
>>> The Main form does not have a conventional title bar. An activeX
>>> component (w/ icon, caption, min button, close button, customizable
>>> gradient BG) serve as the title bar.
>>> No any code in QueryUnload event.
>>>
>>> What could be the possible reasons? Ralph was mentioning queryunload,
>>> but I could not see anything in the post addressing the 'close group'
>>> issue. Is there anything I can do in the QueryUnload to make the
>>> application close all its instances?
>>
>> Well, you could certianly try it, but given you don't have a standard
>> titlebar I'm starting to suspect that your app isn't processing
>> WM_CLOSE at all. What happens when you have a single instance, and
>> just select "Close" from the right-click on the taskbar menu?
>>
>> Since you've chosen to use a non-standard UI, odds are you're going to
>> need to do some message sniffing with Spy++ and probably subclass the
>> hidden top-level window watching for WM_CLOSE. But your use of the 3rd
>> party tool really means only you can troubleshoot this one.
>
> Why is all the really interesting information always so late in
> coming?
>
> -ralph
> <g>

Always, huh!? <g>

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


Lutemann

8/13/2013 2:22:00 PM

0

On Tuesday, August 13, 2013 9:16:14 AM UTC-5, Murdick wrote:
> On Tuesday, August 13, 2013 7:28:52 AM UTC-5, Che wrote:
>
> > On Tuesday, August 13, 2013 4:10:44 AM UTC-5, Che wrote:
>
> >
>
> > > I like her. Yes, she is different and maybe doesn't fit your model of what a guitarist *SHOULD BE* but Filomena Moretti has her own.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > http://www.youtube.com/watch?v=q...
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Wm. D. Jennings
>
> >
>
> >
>
> >
>
> > Not everyone who plays or sings well is looking for validation from others. That craving for acceptance so often seen in the small world of CG in particular, is limiting and self-destructive. Notice what's happened to a few of them who have passed through RMCG. When I say notice, take a close look and see exactly where they are now.
>
> >
>
> >
>
> >
>
> > This young lady plays from freedom, she's fearless. She's a nightingale, how can she keep from playing? She also appears to be creative and that's exactly what the so called CG needs now. I just hope she's mentally tough enough not the let the bastards get her down.
>
> >
>
> >
>
> >
>
> > I'm not much for Christian hymns but if the song fits, play it.
>
> >
>
> >
>
> >
>
> > https://www.youtube.com/watch?v=Z...
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > “Criticism is something you can easily avoid by saying nothing, doing nothing, being nothing” ~Aristotle
>
>
>
> Che says, "Not everyone who plays or sings well is looking for validation from others. " Yes, but almost anyone who does anything wants to improve, and the reasons, which can vary , are irrelevant.

The mistake many on this list make is the belief that criticism is somehow negative. A child seeks approval. When I go into a lesson, and I still do, I'm paying the teacher to tell me what's wrong.