How can I close a window without it doing ANYTHING while it closes??? (It usually shuts another program down.)
Thankyou!
Evan
Printable View
How can I close a window without it doing ANYTHING while it closes??? (It usually shuts another program down.)
Thankyou!
Evan
I don't get it: what do you mean by "doing ANYTHING?"
------------------
Visual Basic Programmer
------------------
PolComSoft
You will hear a lot about it.
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?
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]
Well, The intetnet conection still disconnects when the window goes away. Could I make it so it would stay online?? thankyou aaron!