Form not unloading..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vdraceil
    New Member
    • Jul 2007
    • 236

    Form not unloading..

    I use vb6.i have a small problem guys..my form is not unloading.

    I want my application to end only if the user presses shift+F10.so i run a timer with interval=1 which checks the keyboard state of both the keys.if at any instant both the keys are pressed a messagebox must be displayed and then the form must unload.

    I've done the coding and what happens is the message box is displayed but the form doesnt unload.

    I've tried debugging too.what i see is the unload statement evokes the unload event of the form ,but after this event the form's load event runs again..
    I dont know why this happens..does anybody know why and the solution to this problem??
  • xinariscy
    New Member
    • Sep 2008
    • 14

    #2
    First, you can do what you want to do very easily. Having a timer running all the time is not so good.

    You can make a hidden menu with shortcut key Shift+F10. In the code of the menu, just write the message box you want.

    If user hit OK try the "Unload me" or the "End". Both should quit the program.

    If you want further help about the menu just ask.

    Comment

    • vdraceil
      New Member
      • Jul 2007
      • 236

      #3
      My application runs in the background-the form will be hidden.actually the program is designed to capture the screen at specific time intervals and store it in a folder..so the form wont get the focus and the shift+f10 associated with the menu wont work.
      any alternative idea buddy?

      Comment

      • rpicilli
        New Member
        • Aug 2008
        • 77

        #4
        Hi Friend.

        If your app runs in background and has no iteration with the end user, the best practice is create a Service not a Windows Application.

        If your application never get the focus, the short cut key will never work either.

        You must take care of what key combination you'll use because this will be allways available when your service is running.

        I hope this help

        Comment

        • vdraceil
          New Member
          • Jul 2007
          • 236

          #5
          Ya..even though my application doesnt gets the focus,i manage to track what keys are pressed by using GetAsyncKeyStat e() API function.
          Can you just tell me how to run my application as a windows service?pls..

          Comment

          • Kapps
            New Member
            • Aug 2008
            • 16

            #6
            ...
            You're making a program, which you want hidden from the user and run as a service, that logs all keypresses the user inputs, and makes screenshots of whatever they're doing?

            We call that illegal.

            Comment

            • vdraceil
              New Member
              • Jul 2007
              • 236

              #7
              i'm just trying to monitor my own computer-i feel thats not illegal.
              moreover i'm not building a keylogger.
              what i'm trying to make is a application that monitors every new window opened-i dont think its gonna cause any harm to anyone.

              i've completed the programming thing,but the problem is the form is not unloading as i said before.thats why i need help from members of this forum.
              i'm trying it myself but i dunno why it happens and i feel this part difficult.

              has anyone faced this kind of problem before?any solution to make my form unload on pressing shift+F10?

              Comment

              Working...