• 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
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
 
:(

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

 
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.
 
How do you exit out of your client?
Would you mind contacting me on MSN?
 
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.
 
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