[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 02-09-2006, 08:58 AM   #1 (permalink)
NamePros Member
 
Join Date: Oct 2005
Location: USA
Posts: 196
7.05 NP$ (Donate)

ralxz is an unknown quantity at this point


Run a program before fully logging off

Hey guys. I'm looking to write a progam that would backup a directory before fully logging off. The ideal possibility would be: User Clicks Logoff -> Program Runs -> Logoff completes when program exits. Do you guys know how to interrupt a logoff like this?

Thanks,
Ryan
__________________
Freelance Graphic Designer for Hire
Portfolio

Contact info here.
ralxz is offline  
Old 02-09-2006, 09:51 AM   #2 (permalink)
Eating Pie
 
iNod's Avatar
 
Join Date: Nov 2004
Location: Canada
Posts: 2,289
126.05 NP$ (Donate)

iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of

Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
Well if you run the command

shutdown -r

When you do the command to shutdown it stops the shutdown. It may work for logout try it and let me know how it works.

I know there is also something in register which you can edit that will pause or slow down logout. Allowing for a backup. I don't recommand banging around in registry but you can reasearch abit. Maybe take a look at the coding on time logouts. Like at the libary. See how they did it. Find a way to stop the logout and than run the program than set it to logout. Something like that :S

- Steve
__________________
I feel old.

Last edited by iNod; 02-09-2006 at 09:59 AM.
iNod is offline  
Old 02-09-2006, 07:45 PM   #3 (permalink)
NamePros Member
 
Join Date: Aug 2005
Posts: 109
78.00 NP$ (Donate)

JustinWI is an unknown quantity at this point


What code langauage? I have some code i found and modified for vb .net to recognize a logoff command and then write to a db table and then logoff.

Code:
Private Shared WM_QUERYENDSESSION As Integer = &H11
    Private Shared systemShutdown As Boolean = False
    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        If m.Msg = WM_QUERYENDSESSION Then
' Insert command to run here            
systemShutdown = True
        End If
        MyBase.WndProc(m)
    End Sub 'WndProc 

    Private Sub Form1_Closing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        If (systemShutdown) Then
            systemShutdown = False
           e.Cancel = False
           End If
    End Sub
JustinWI is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Great Scripts for Sale With Resale Rights! Zeeble Scripts For Sale 20 01-04-2006 01:39 AM
NEW : Google AdSense(TM) Online Standard Terms and Conditions Mark Google Adsense 3 11-04-2005 12:37 PM
DomainHop Shan PPC / CPC / CPM Programs 82 06-06-2005 03:48 PM
Run an Affiliate Program? Read This JNav For Sale / Advertising Board 0 04-09-2004 11:01 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 05:14 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85