• Log in or sign up for an account here: https://www.sythe.org/login

Terminate Process On Close?

0h n035

Active Member
Joined
Feb 1, 2007
Sythe Gold
0
Messages
163
Location
Australia
Terminate Process On Close?
Okay. I have My Splash Screen:

Code:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1

Private Sub Form_Load()
  Dim TempValue As Long
  Dim MyWidth As Long, MyHeight As Long
  Dim MyTop As Long, MyLeft As Long
  
  MyWidth = 430
  MyHeight = 205
  
  MyLeft = Screen.Width / (4 * Screen.TwipsPerPixelX)
  MyTop = Screen.Height / (4 * Screen.TwipsPerPixelY)
'Call SetWindowPos API function
  TempValue = SetWindowPos(Me.hwnd, HWND_TOPMOST, MyLeft, MyTop, MyWidth, MyHeight, SWP_SHOWWINDOW)
End Sub

Private Sub Timer1_Timer()
Me.Cls
Splash.Cls
Unload Me
Unload Splash
Main.Show
Timer1.Enabled = False
End Sub

It seems to only hide when the timer reaches zero. I want it so that it actually CLOSES or so that when I close the Main Form (Main.frm) it closes/terminates everything to do with the Program.

Thanks, 0h N035
 
Terminate Process On Close?
:(

Bad way:
Code:
End
Good way:
Code:
    Dim frm As Form
    For Each frm In Forms
        Unload frm
    Next frm

 
Terminate Process On Close?
I don't even have End XD

I've tried End and what you gave me but nothing will work. I Exit out of my client yet it still runs in my processes.
 
Terminate Process On Close?
How do you exit out of your client?
Would you mind contacting me on MSN?
 
Terminate Process On Close?
Nevermind, fixed :D

For some reason, this worked:

Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
On Error Resume Next
Dim retval As Integer
    retval = MsgBox("You should make sure you're disconnected from Runescape before closing the client. Do you want to exit?", vbQuestion + vbYesNo, "Exit ShadowClient?")
    If retval = vbNo Then
        Cancel = 1
        Exit Sub
    End If
    End
End Sub

Just 'End' or Unload Form, etc never worked before.
 
Terminate Process On Close?
Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    if MsgBox("You should make sure you're disconnected from Runescape before closing the client. Do you want to exit?", vbQuestion + vbYesNo, "Exit ShadowClient?") = vbyes then
        dim frm as form
        for each frm in forms
             if lcase(me.name) <> lcase(frm.name) then
                 unload frm
             end if
        next frm
        unload me
    else
        cancel = 1
    end if
End Sub

Also you should really have a second look at that code on your splash screen and make it a little more effecient.
 
Runescape Gamblingrunescape gambling
Back
Top