How to unload the stack of forms in VB6

Discussion in 'Visual Basic ( VB )' started by sharmila, Feb 20, 2012.

  1. sharmila

    sharmila New Member

    Joined:
    Mar 24, 2006
    Messages:
    75
    Likes Received:
    1
    Trophy Points:
    0
    I have an application in VB6 for which I am implementing the Autologout functionality. Whenever the application is in idle state for some time, the user will be logedout by closing all the forms that user has been loaded. I am using a FormStack and unloading all the forms that has been loaded. Inorder to close the forms in a proper way we are using SendKeys ESC and the form will unload with ESC key.

    It is working fine in most of the cases, but the problem is if there is something like Keyboard, then with the ESC key the keyboard is getting unloaded, but once all the forms are unloaded, the code next to Keyboard is getting executed which has a reference to forms control and loading the form.

    I can do the reference checks, but this functionality is implemented in many places, and it takes time to check everywhere.

    I also thought to wait for some time around 500 ms to close every form, but felt it is not good to relay on timers.

    Could anyone suggest a better idea to uload all the forms smoothly.

    Thanks in advance.
     
  2. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28
    can you send a small demo project of what you want to do?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice