473,372 Members | 1,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

OnSessionEnding(object sender, SessionEndingEventArgs e) fasiles

hi,

I have a windows form that when it closes it simply hides itself in
combination for a notify icon to reactivate it again - like Microsoft
messenger. You have to specifically exit the application by right clicking
on the NotifyIcon and selecting Exit from it's context menu.

I'm overriding the OnClosing event, hiding the form, and setting the
CancelEventArgs.Cancel to true so that the app is not closed but instead
remains alive on the system tray (NotifyIcon). But this causes a problem
when you shutdown Windows, the OnClosing is overridden by my code since I
can tell the difference between the user pressing the X to close the window
or Windows closing it for a system shutdown. So when this application is
running, the system will not shut down until you manually close this
application - which I don't need to tell you how frustrating that is to
users.

Some body will sure suggest me to use

public void OnSessionEnding(object sender, SessionEndingEventArgs e)

to control the shutdownevent and close the window in that.

But this event is not working properly. Can any body can give me some lights
over this issuse.

what i need is a code sample or references to matterial about it.

Looking for a working sample if possible.

Thanks.

Regards,
Waqar
Jul 21 '05 #1
1 2012
please review following link,
http://www.dotnet247.com/247referenc.../14/74770.aspx

have the same discussion , but OnSessionEnding( event is not fired. There
is some problem???

Any sugestion ??

.....
"Waqar" wrote:
hi,

I have a windows form that when it closes it simply hides itself in
combination for a notify icon to reactivate it again - like Microsoft
messenger. You have to specifically exit the application by right clicking
on the NotifyIcon and selecting Exit from it's context menu.

I'm overriding the OnClosing event, hiding the form, and setting the
CancelEventArgs.Cancel to true so that the app is not closed but instead
remains alive on the system tray (NotifyIcon). But this causes a problem
when you shutdown Windows, the OnClosing is overridden by my code since I
can tell the difference between the user pressing the X to close the window
or Windows closing it for a system shutdown. So when this application is
running, the system will not shut down until you manually close this
application - which I don't need to tell you how frustrating that is to
users.

Some body will sure suggest me to use

public void OnSessionEnding(object sender, SessionEndingEventArgs e)

to control the shutdownevent and close the window in that.

But this event is not working properly. Can any body can give me some lights
over this issuse.

what i need is a code sample or references to matterial about it.

Looking for a working sample if possible.

Thanks.

Regards,
Waqar

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Manfred Braun | last post by:
Hi All, I am trying to fetch system-events, and I am successful with "TimeChanged", but cannot get "SessionEnding". I am not an OO expert and so - just to be sure - I made all my methods public...
0
by: Manfred Braun | last post by:
Hi All, I am trying to fetch system-events, and I am successful with "TimeChanged", but cannot get "SessionEnding". I am not an OO expert and so - just to be sure - I made all my methods public...
1
by: Waqar | last post by:
hi, I have a windows form that when it closes it simply hides itself in combination for a notify icon to reactivate it again - like Microsoft messenger. You have to specifically exit the...
1
by: Waqar | last post by:
hi, I have a windows form that when it closes it simply hides itself in combination for a notify icon to reactivate it again - like Microsoft messenger. You have to specifically exit the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.