473,387 Members | 1,483 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,387 software developers and data experts.

Logout Feature..

VJ
I am trying to provide a logout feature for my application...This should
close all open windows within my application and display the login screen.
How would Determine what windows are open and close them.

VJ
Nov 20 '05 #1
4 969
You could use the FindWindow win32 function via pinvoke assuming you know the captions of your windows. You would run into problems if it is possible to have multiple instances of your application running with this solution. You could also keep track of which windows are created by creating a class that keeps track of this information, and have the constuctors for your forms classes add themselves to this class. (make the dispose method remove the form as well). A static method on the "forms tracking" class is probably the easiest way to add / remove the references to your forms.

There might be better ways to do this, but these are a few possible ideas.

Jackson Davis [msft]
--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 20 '05 #2
You could use the FindWindow win32 function via pinvoke assuming you know the captions of your windows. You would run into problems if it is possible to have multiple instances of your application running with this solution. You could also keep track of which windows are created by creating a class that keeps track of this information, and have the constuctors for your forms classes add themselves to this class. (make the dispose method remove the form as well). A static method on the "forms tracking" class is probably the easiest way to add / remove the references to your forms.

There might be better ways to do this, but these are a few possible ideas.

Jackson Davis [msft]
--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 20 '05 #3
You could use the FindWindow win32 function via pinvoke assuming you know the captions of your windows. You would run into problems if it is possible to have multiple instances of your application running with this solution. You could also keep track of which windows are created by creating a class that keeps track of this information, and have the constuctors for your forms classes add themselves to this class. (make the dispose method remove the form as well). A static method on the "forms tracking" class is probably the easiest way to add / remove the references to your forms.

There might be better ways to do this, but these are a few possible ideas.

Jackson Davis [msft]
--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 20 '05 #4
You could use the FindWindow win32 function via pinvoke assuming you know the captions of your windows. You would run into problems if it is possible to have multiple instances of your application running with this solution. You could also keep track of which windows are created by creating a class that keeps track of this information, and have the constuctors for your forms classes add themselves to this class. (make the dispose method remove the form as well). A static method on the "forms tracking" class is probably the easiest way to add / remove the references to your forms.

There might be better ways to do this, but these are a few possible ideas.

Jackson Davis [msft]
--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 20 '05 #5

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

Similar topics

2
by: Vinod I | last post by:
Hi Team, I would like to know how "Logout" can be handled in asp.net page. Scenario is like this:- I have a "logout" option in my menu. As soon as user clicks this, will show a "Sucessfully...
2
by: Jon Natwick | last post by:
I'm trying to add a dynamically created logout link on my pages. The link to the logout page will show if the user is logged in. I put a placeholder on the aspx page and then dynamically create...
4
by: ad | last post by:
I use the Login controls of Asp.net 2.0 in my program. I want to logout a user by program, I try Session.Abandon() for this. But I found that the user is the same after I execute Session.Abandon()....
0
by: ShailShin | last post by:
Hi All, Developing an VB App for Login and logout tracking. In App Form there are two buttons login and logout. When user click on login the loginName, LoginTime and LoginDate get stored in...
25
by: crescent_au | last post by:
Hi all, I've written a login/logout code. It does what it's supposed to do but the problem is when I logout and press browser's back button (in Firefox), I get to the last login page. In IE,...
10
by: chaos | last post by:
How to do logout alert message when i press on the logout image <a href="../logout.php" target="_top" onClick="return logout()"...
1
by: shrik | last post by:
hi everybody. I have following problem. There are two pages. index.jsp and main.jsp in my application Index.jsp contains logging interface in . It submits password and userid to loginform bean. ...
1
by: Kandiman | last post by:
Hiya, i made a asp page, and one of my divs (as a include) is as below. the problem is if the main page is resubmitted, i get logged out again?... heres the code.. i think its on the value=true...
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.