Results 1 to 6 of 6

Thread: Disable "Ending Program" in windows XP?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2003
    Location
    Greece, Salonica
    Posts
    473

    Post Disable "Ending Program" in windows XP?

    Hi.Is there a way to disable the "Ending Program" screen when Windows XP shuts down?I want to do this because I want to make a program in VB that will copy some files into my LAN computer when it unloads.
    So because windows will see that it "doesnt want" to end windows will wait a little and then close the program...
    But actually i havent tried it testing this so Im not sure if this Ending Program screen would appear but im guessing...

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Shut Down Service: You, shut down!

    Your Program: I have to do something first.

    Shut Down Service: May it quick!

    Your Program: No problem.

    Shut Down Service: You done yet?

    Your Program: What? No not yet, just started..

    Shut Down Service: Come on already..

    Your Program: Wait just one second, still working on it...

    Shut Down Service: Jesus christ, what the hell are you doing anyway?

    Your Program : Just copying some files over the lan..

    Shut Down Service: Fine.. I'll popup an Ending Program box...

    Your Program: Thanks

    Shut Down Service: Right. Right.

    < 2 seconds pass>

    Shut Down Service: We kosher?

    Your Program: Almost.

    Shut Down Serivce: Ok thats it, I can't help you out any longer.
    You shut down, or I'll shut you down the hard way.


    Your Program: Huh? Chill... almost done.

    Shut Down Service: I've had enough of YOO!


    Shut Down Service (to Windows): We're all ready here.

    Windows: You sure? I still see some lan activity.

    Shut Down Service: This jerk won't shut down.

    Windows: You, program!

    Your Program: Hi Windows!

    Windows: Shut Down!

    Your Program: Yes sir, just doing some very important stuff here.

    Windows: Are you are Microsoft program?

    Your Program: Um... why yes I am.

    Windows: BS! Let me see your certificate!

    Your Program: Its laying around here somewhere..

    Windows: Yea right. Shut him down!

    Shut Down Service: Gladly!

    Your Program: Wait three more bytes and I'm...

    <silence>

    Windows: We all good here?

    Shut Down Service: I think so. Hey, just for fun, want to send out an error report?

    Windows: Hell yea!
    Last edited by nemaroller; Mar 3rd, 2004 at 11:20 PM.

  3. #3
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    If it can't close the program, the prompt just stays on the screen, you can do something to the form_unload to prevent it from doing this and then allow it when it's finished.
    Last edited by Ideas Man; Mar 4th, 2004 at 12:32 AM.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    VB Code:
    1. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    2.  
    3.     Select Case UnloadMode
    4.         Case vbFormControlMenu
    5.             strMess = "The user chose the Close command (the "X") from the Control menu on the form."
    6.         Case vbFormCode
    7.             strMess = "The Unload statement is invoked from code."
    8.         Case vbAppWindows
    9.             strMess = "The current Microsoft Windows operating environment session is ending."
    10.         Case vbAppTaskManager
    11.             strMess = "The Microsoft Windows Task Manager is closing the application."
    12.         Case vbFormMDIForm
    13.             strMess = "An MDI child form is closing because the MDI form is closing."
    14.         Case vbFormOwner
    15.             strMess = "A form is closing because its owner is closing."
    16.     End Select
    17.  
    18. End Sub

  5. #5
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    That's it, very nicely done Martin.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

  6. #6
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    VB Code:
    1. Case vbFormControlMenu
    2.             strMess = "The user chose the Close command (the "X") from the Control menu on the form."

    Should be :

    VB Code:
    1. Case vbFormControlMenu
    2.             strMess = "The user chose the Close command (the [b]""X""[/b]) from the Control menu on the form."

    otherwise there is an error


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width