|
-
Aug 17th, 2000, 06:57 PM
#1
Thread Starter
Registered User
Hi...
Let's say I have a program running, when I press Alt+Ctrl+Del, I see its name "ABCD".
It is running in the background, I wanna FORCE the program "ABCD" to exit.
How do I do that?
Thanks.
-
Aug 17th, 2000, 07:06 PM
#2
Here's a good example on how to list all the applications running in a listbox and than kill them.
App List and Kill
-
Aug 17th, 2000, 07:29 PM
#3
Send the WM_CLOSE message with the DestroyWindow function. This example will close Calculator.
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Const WM_CLOSE = &H10
Private Sub Command1_Click()
Dim hApp As Long
hApp = FindWindow(vbNullString, "Calculator")
Call SendMessage(hApp, WM_CLOSE, 0, 0)
Call DestroyWindow(hApp)
End Sub
-
Aug 18th, 2000, 02:33 AM
#4
Thread Starter
Registered User
Thanks.
Thank u, Megatron.
Worked.
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
|