|
-
Jan 10th, 2000, 03:49 AM
#1
Thread Starter
Addicted Member
How can I close a window without it doing ANYTHING while it closes??? (It usually shuts another program down.)
Thankyou!
Evan
-
Jan 10th, 2000, 03:52 AM
#2
Fanatic Member
I don't get it: what do you mean by "doing ANYTHING?"
------------------
Visual Basic Programmer
------------------
PolComSoft
You will hear a lot about it.
-
Jan 10th, 2000, 05:16 AM
#3
Thread Starter
Addicted Member
I want to send it a command to close it without it being able to go through its Form_Unload code (Its another app).
Is that possable?
-
Jan 10th, 2000, 05:31 AM
#4
You can force the App to Terminate, bypassing any Shutdown procedures it may have in place, ie.
Code:
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Sub TerminateIt(ByVal lHwnd As Long)
Dim lProcess As Long
Dim lExitCode As Long
'Get the ProcessID
Call GetWindowThreadProcessId(lHwnd, lProcess)
'Get the Process Handle
lProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, lProcess)
'Get the Exitcode
Call GetExitCodeProcess(lProcess, lExitCode)
'Terminate the Process
Call TerminateProcess(lProcess, lExitCode)
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 10th, 2000, 10:36 AM
#5
Thread Starter
Addicted Member
Well, The intetnet conection still disconnects when the window goes away. Could I make it so it would stay online?? thankyou aaron!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|