Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2007

Tip: Looking for answers? Try searching our database.

.net BroadcastEventWindow on logoff with complicated achitecture

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Bardon - 13 Sep 2007 17:50 GMT
I have a problem with an application that is popping up a ".net
BroadcastEventWindow" on shutdown/log off, and I can't seem to figure
out how to get rid of it.  The problem is that the whole setup is a
little bit convoluted.  I have a singleton COM server that uses
windows forms, and for the most part everything works as expected.
The forms each start their own threads, they all exit as expected if I
remove all instances to my COM singleton, and sometimes even exit
correctly on logoff.  The problem comes when I register one of these
forms as an Appbar in windows to dock it at the top of the screen.

For the docked window, I've tried capturing the SessionEnding event on
the systemevents class, and I've overridden the WndProc and tried to
catch WM_QUERYENDSESSION, WM_QUIT, and WM_ENDSESSION.  The window
still catches these messages when I log off, but not until after the
BroadcastEventWindow comes up and times out (and if I hit cancel).
I'm wondering-is there anonther way to detect log off/shutdown that
will come in before windows tries to kill the BroadcastEventWindow?
In addition to te above, the form's Closed and Closing events aren't
fired until after the BroadcastEventWindow error either, so I'm
starting to run out of options here.  If I can come up with a way to
catch the log off before the error comes up, I should be able to exit
gracefully.

Anyone have any ideas?  I know I'm not giving you much to go on here,
but I'm trying to put together a smaller sample that can replicate the
problem to post.

Thanks for the help,

Chris
Chris Bardon - 14 Sep 2007 16:30 GMT
Well, it turns out that there is a "solution" out there, even if it is
a bit of a cheat.  If you look in the registry under HKCU\Control Panel
\Desktop there's a value called AutoEndTasks that you can set to 1 to
suppress all of those "End Task" dialogs.  It looks like anything that
suppresses shutdown/logoff isn't affected by this, so really all it
does is force the OS to kill any lingering processes.  True, not an
ideal solution, but one to try if you're running into similar
problems.

> I have a problem with an application that is popping up a ".net
> BroadcastEventWindow" on shutdown/log off, and I can't seem to figure
[quoted text clipped - 26 lines]
>
> Chris

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.