PDA

Click to See Complete Forum and Search --> : Must KILL Winword.exe


OlgaV
Nov 30th, 1999, 03:15 AM
Hi!!!

My Windows NT Task Manager is driving me crazy. Using VB, how can I end Winword.exe application from my "Processes" tab? The "Processes" tab doesn't recognize the word "Quit". "Applications" tab does not show that the application is running at all.

Please tell me what to do if you can!

Thank you!

Aaron Young
Nov 30th, 1999, 03:47 AM
Try:

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()
'OpusApp is the Classname of MSWord
Call SendMessage(FindWindow("OpusApp", vbNullString), WM_CLOSE, 0&, ByVal 0&)
End Sub


------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net

OlgaV
Dec 1st, 1999, 03:16 AM
Aaron, thanks so much!
Is there anything you don't know? :)
You've helped me on several ocasions already.
Thanks again.

Olga.