Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Visual Basic Help] Do on Exit?  (Read 1883 times)

0 Members and 1 Guest are viewing this topic.
[Visual Basic Help] Do on Exit?
« on: October 28, 2006, 01:53:46 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 562
For example if I closed my program using taskmanager, is there a code that makes something happen when it closes?  Thanks in advance.
Logged
Re: [Visual Basic Help] Do on Exit?
« Reply #1 on: October 28, 2006, 02:25:59 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Which version of Visual Basic are you using?

If I remember correctly from when I had VB6 Pro, there was an OnExit, OnClosing, or something similar if you go up to the list of form functions.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: [Visual Basic Help] Do on Exit?
« Reply #2 on: October 28, 2006, 02:47:54 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 562
Which version of Visual Basic are you using?

If I remember correctly from when I had VB6 Pro, there was an OnExit, OnClosing, or something similar if you go up to the list of form functions.
I'm using VB6...  And I don't see the OnExit and OnClosing thing.
Logged
Re: [Visual Basic Help] Do on Exit?
« Reply #3 on: October 28, 2006, 02:59:45 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Hmm... There SHOULD be SOMETHING dealing with closing o_O

One sec, I'm gonna check VB 2005 Express, it should tell me what I'm looking for for you (similarity reasons <_<)

[MinEdit]
AH! That's right, I think it was Unload!
« Last Edit: October 28, 2006, 03:03:08 pm by MiNalien »
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: [Visual Basic Help] Do on Exit?
« Reply #4 on: October 28, 2006, 06:24:50 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 562
Hmm... There SHOULD be SOMETHING dealing with closing o_O

One sec, I'm gonna check VB 2005 Express, it should tell me what I'm looking for for you (similarity reasons <_<)

[MinEdit]
AH! That's right, I think it was Unload!
Yes, but for unload it only works if you press the exit button, but if you close it in Proccess List then it avoids that.
Logged
Re: [Visual Basic Help] Do on Exit?
« Reply #5 on: October 28, 2006, 06:43:21 pm »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
In VB2005, there's a formclosed and formclosing event. You should be able to put your event in there, I think.Then, if your program is closed with Task Manager but is still responding, it should still close properly.
Logged
  • Broken Kings [Temp Site]

Dayjo

shut the fuck up donny.
Re: [Visual Basic Help] Do on Exit?
« Reply #6 on: October 28, 2006, 06:59:46 pm »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
If you want to stop Task Manager from being able to close your program I believe you have to hook the TerminateProcess API (which i've never done because It's pretty difficult (for me anywho)). If you do it correctly, when you try and terminate the program it should say an "Access Denied" message.

If you want to "hide" the program in Task Manager put something like this into your app:

Code: [Select]
Private Sub Form_Load()
App.TaskVisible = False
End Sub

However, it will remain the process list. Name your program something obscure like "svchost.exe", and it might stop people trying to close it. This is what I did with my keylogger (there's still a way of terminating it, but it makes it a little bit more difficult).
Logged
  • My Blog
Re: [Visual Basic Help] Do on Exit?
« Reply #7 on: October 28, 2006, 07:23:50 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Jesus, Dayjo, explain how to hide bad applications much? <_<

Anyways, I dont think VB6 has FormClosing or FormClosed events, TRW
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog

Dayjo

shut the fuck up donny.
Re: [Visual Basic Help] Do on Exit?
« Reply #8 on: October 28, 2006, 07:29:59 pm »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
There is Form_Unload() and also Form_QueryUnload(Cancel As Integer, UnloadMode As Integer).

You MIGHT catch the Task Manager terminate with QueryUnload with something like this:

Code: [Select]
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    if UnloadMode = vbAppTaskManager Then
      msgbox "closing via task manager"
    end if
   
End Sub

But it's not guaranteed, and again probably wont work if they terminate the service rather than just he application on task manager. It's worth a try though.

And Min, keyloggers aren't "bad" apps necessarily, they can be used for non-malicious purposes.
« Last Edit: October 28, 2006, 07:36:55 pm by Dayjo »
Logged
  • My Blog
Re: [Visual Basic Help] Do on Exit?
« Reply #9 on: October 28, 2006, 10:52:07 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 562
Wait, is there a way to remove the program from the proccess list?  Since currently anyone can just go to Process List and press End Proccess.
Logged
Re: [Visual Basic Help] Do on Exit?
« Reply #10 on: October 28, 2006, 10:55:15 pm »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
I certainly hope not, as far as I'm concerned,the user should always know everything that's running on their computer.
Logged
  • Broken Kings [Temp Site]
Re: [Visual Basic Help] Do on Exit?
« Reply #11 on: October 28, 2006, 11:34:55 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 562
I certainly hope not, as far as I'm concerned,the user should always know everything that's running on their computer.
Well, I'm only using it to hide HackerWall.
Logged

Dayjo

shut the fuck up donny.
Re: [Visual Basic Help] Do on Exit?
« Reply #12 on: October 28, 2006, 11:51:21 pm »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
No.

(to my knowledge, it would be rediculous if you could)
« Last Edit: October 28, 2006, 11:53:35 pm by Dayjo »
Logged
  • My Blog
Re: [Visual Basic Help] Do on Exit?
« Reply #13 on: October 29, 2006, 07:33:26 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
Hiding an app from the list still isnt good enough. You can DL programs that find hidden processes.
Logged
the a o d c

Dayjo

shut the fuck up donny.
Re: [Visual Basic Help] Do on Exit?
« Reply #14 on: October 29, 2006, 04:57:37 pm »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
Hiding an app from the list still isnt good enough. You can DL programs that find hidden processes.
Not "Good Enough", is often the only option in software development. Unfortunately there are SOME restrictions with what you can do, and hiding processes is one of them. If it were an easy task, just think how much easier it would be to make spyware / adware.

Like I said, the best option is to hide it and make it only show in the service list, and just name it as something that's always there like svchost.exe (anyone who's done this before however, won't have THAT much trouble in finding and terminating the program).

If you succeed in hooking the TerminateProcess API then you're chances of stopping the program closing increase dramatically. However, I still think that having a separate program for stopping 'hecking' in a game is ... impractical. Unfortunately, Game Maker probably isn't the best program to try and API hook with, so I guess it's the next best thing.

Good luck anyway.
« Last Edit: October 29, 2006, 05:06:33 pm by Dayjo »
Logged
  • My Blog
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.048 seconds with 68 queries.