Hi,
how wud i be able to close my running VB exe while it is running........?
Thanks and Regards
vivek.s
Printable View
Hi,
how wud i be able to close my running VB exe while it is running........?
Thanks and Regards
vivek.s
Task manager.
Never tried it in code.
If you mean from inside the running program then do thisQuote:
Originally Posted by vivek.shankar
Code:Public Sub UnloadAllForms()
For Each frm In Forms
Unload frm
Set frm = Nothing
Next
Exit Sub
i wanted one program to close another exe.........like we go and close using taskbar.......
thanks and regards
vivek.s
Code:Private Declare Function CloseWindow Lib "user32" Alias "CloseWindow" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Dim lngRetVal as long
lngRetVal=FindWindow(vbnullstring,"Name of my App")
CloseWindow lngRetval
the process could still be open or the process even dont have a form...
yes exactly.......sometimes form is closed but process is still in the memory.......
regards
vivek.s
you should try TerminateProcess API i dont even know if it exists though you could try