|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Closing Grouped instances in the taskbarHi 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 On Wed, 1 Sep 2010 10:51:59 -0700 (PDT), Sneha Menon
<spiderang***@gmail.com> wrote: >Hi All Have you defined a QueryUnload Event?> >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) > 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 Sneha Menon formulated on Wednesday :
> VB6 Application. If there are a number of instances of the application Almost certainly, nothing. Windows will just attempt to "close > 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) 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". On Wed, 01 Sep 2010 14:17:37 -0700, Karl E. Peterson <k***@exmvps.org>
wrote: >Sneha Menon formulated on Wednesday : That's why I suggested the QueryUnload ... my guess is the OP is>> 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". 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 ralph explained on 9/1/2010 :
Show quoteHide quote > On Wed, 01 Sep 2010 14:17:37 -0700, Karl E. Peterson <k***@exmvps.org> Yeah, I'd hoped to imply that with the last sentence.> 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 Oops. <g>> "one way out" or keeping a resource alive, I forget there may be times > you want to let the O/S close it. <g> > Almost certainly, nothing. Windows will just attempt to "close That's what I had thought. And, as almost all the projects I had> nicely", presumably by sending WM_CLOSE to the top-level window, all > apps in that group. 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 Sneha Menon pretended :
Show quoteHide quote >> Almost certainly, nothing. Windows will just attempt to "close Well, you could certianly try it, but given you don't have a standard >> 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? 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. On Wed, 01 Sep 2010 18:05:27 -0700, Karl E. Peterson <k***@exmvps.org>
wrote: Show quoteHide quote >Sneha Menon pretended : Why is all the really interesting information always so late in>>> 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. coming? -ralph <g> After serious thinking ralph wrote :
Show quoteHide quote > On Wed, 01 Sep 2010 18:05:27 -0700, Karl E. Peterson <k***@exmvps.org> Always, huh!? <g>> 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> 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" <spiderang***@gmail.com> wrote in message That's what I had thought. And, as almost all the projects I hadnews: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. 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 |
|||||||||||||||||||||||