|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ActiveX control cleanup in IEcontrol contains several other user controls which provide unicode-capable labels, command buttons, text boxes, and list boxes. Because I'm creating windows and subclassing them it's critical that they be released properly. Testing the control on a VB form I was able to rely on the terminate event but apparently IE only fires that if it's a Tuesday after a full moon and the stock market is up for the day. After some digging I found that a workaround is to use the Hide event instead and that was working great in win2k and xp using ie6 and/or ie7 but when I got to Vista it no longer fires. I've tried watching for WM_CLOSE or WM_DESTROY on the main usercontrol window but that didn't help either. I've been able to work around the issue by adding code in the html to call a cleanup method when the browser fires the onbeforeunload event but that's a real hack. Does anybody have any experience with activex controls hosted by ie7 under Vista? Any thoughts on how I can detect the user closing the page or navigating away? "Bob Butler" <noway@nospam.ever> wrote in message <cut>news:OVNo31I2JHA.4744@TK2MSFTNGP04.phx.gbl... > Does anybody have any experience with activex controls hosted by ie7 under Of course, after posting I went back and can no longer get IE7 under Vista > Vista? Any thoughts on how I can detect the user closing the page or > navigating away? to fail. It fires the Hide event every time just like it does under other OS versions. As Emily Litella would say, "Nevermind..." Bob Butler wrote:
> Of course, after posting I went back and can no longer get [it] to fail. Cool workaround! :-)
Show quote
Hide quote
"Bob Butler" <noway@nospam.ever> wrote in message Does the Terminate event work?news:er5bK7I2JHA.1096@TK2MSFTNGP06.phx.gbl... > > "Bob Butler" <noway@nospam.ever> wrote in message > news:OVNo31I2JHA.4744@TK2MSFTNGP04.phx.gbl... > <cut> >> Does anybody have any experience with activex controls hosted by ie7 >> under Vista? Any thoughts on how I can detect the user closing the page >> or navigating away? > > Of course, after posting I went back and can no longer get IE7 under Vista > to fail. It fires the Hide event every time just like it does under other > OS versions. > > As Emily Litella would say, "Nevermind..." Try switching tabs, and closing tabs without activating them to cover all situations. "Bob Butler" <noway@nospam.ever> wrote in (Top-opsted for brevity)news:OVNo31I2JHA.4744@TK2MSFTNGP04.phx.gbl: I'm guessing this is an internal webpage only ???? Like for a companies employees to use ? Show quoteHide quote > I've been working on an activex control to be hosted on a web page. > The control contains several other user controls which provide > unicode-capable labels, command buttons, text boxes, and list boxes. > > Because I'm creating windows and subclassing them it's critical that > they be released properly. Testing the control on a VB form I was > able to rely on the terminate event but apparently IE only fires that > if it's a Tuesday after a full moon and the stock market is up for the > day. After some digging I found that a workaround is to use the Hide > event instead and that was working great in win2k and xp using ie6 > and/or ie7 but when I got to Vista it no longer fires. I've tried > watching for WM_CLOSE or WM_DESTROY on the main usercontrol window but > that didn't help either. > > I've been able to work around the issue by adding code in the html to > call a cleanup method when the browser fires the onbeforeunload event > but that's a real hack. > > Does anybody have any experience with activex controls hosted by ie7 > under Vista? Any thoughts on how I can detect the user closing the > page or navigating away? |
|||||||||||||||||||||||