dcsimg
Results 1 to 7 of 7

Thread: Computer not turn off when running project vb

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    117

    Computer not turn off when running project vb

    i made project and convert .exe file
    i run project
    icon show on timer bar
    but when i turn off computer not my computer off
    when i close my project in using the timer bar icon
    again click turn off then my computer off

    While avast and ccleaner is already running on my computer

    even then my computer off but when i run my project then my computer not off

    what problem my project and what more insert code

    thanks

  2. #2

  3. #3
    PowerPoster
    Join Date
    Oct 2013
    Posts
    3,184

    Re: Computer not turn off when running project vb

    Somehow his application is preventing the "shut down" of the OS to work.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    117

    Re: Computer not turn off when running project vb

    not my PC shut down when i run project

  5. #5
    Junior Member
    Join Date
    Jan 2018
    Posts
    21

    Re: Computer not turn off when running project vb

    So your application isn't responding to the normal OS close request / isn't responding in a timely fashion. Do you have any forms in your project? Check the Form_QueryUnload event - is the OS closing forms in a different order than you expect and causing an error condition? Do you not have any forms? - maybe you need something to watch for the OS close and do a proper close of your app.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    117

    Re: Computer not turn off when running project vb

    I Using this project

    zip file upload with form and .exe
    Attached Files Attached Files

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    23,778

    Re: Computer not turn off when running project vb

    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    Cancel = 1
    Me.Hide
    End Sub
    setting cancel = 1 (true) will prevent the application from closing, windows would have to force it to close to complete shutdown

    see post #5 above
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width