|
-
Apr 17th, 2000, 05:26 PM
#1
Any one know how to end task\kill\close\etc. a program. For say I make up a program that creates a icon in the system tray but I don't want the program to "end" it self. I want to make anouther program to end task the system tray icon program. Kind of like the Ctrl-Alt-Delete taskman.exe program. Where you "end task" (I know there is a differecne between end task and close.) a program.
-
Apr 17th, 2000, 08:18 PM
#2
Addicted Member
Hi
You nedd to declare these functions / constents
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 Const WM_CLOSE = &H10
Private Sub Command1_Click()
Dim Whnd&, Ret&
Whnd = FindWindow(vbNullString, "Solitaire")
If Whnd <> 0 Then
Ret = SendMessage(Whnd, WM_CLOSE, 0&, 0& )
End If
End Sub
'The above example will close Solitaire game if is running
HTH
Geoff
[Edited by Geoff Gunson on 04-18-2000 at 12:03 PM]
-
Apr 19th, 2000, 05:54 PM
#3
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
|