Close a running exe
-
Hi Friendz! Do any one know how to close a running exe in vb 6.0 PLz tell me as early as possible. Work Hard and Test your Luck
Try this: http://www.vbsquare.com/api/tip233.html[^]
-
Hi Friendz! Do any one know how to close a running exe in vb 6.0 PLz tell me as early as possible. Work Hard and Test your Luck
Looks like Ray's solution should work, the basic idea is that you will need the handle to the window you want to close. Once you have the handle to the window you will then send a message to the message queue passing it the WM_CLOSE message to close that Window. So all you need is something like this: Define these in a module:
Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal _
Msg As Long, wParam As Any, lParam As Any) As Long
Public Const WM_CLOSE = &H10Your code:
Dim hWnd As Long 'You will want the handle to the window you want to close 'however this is just an example with the handle to the 'current window. hWnd = Me.hWnd result = SendMessage(hWnd, WM\_CLOSE, ByVal CLng(0), ByVal CLng(0))
HTH Nick Parker
-
Hi Friendz! Do any one know how to close a running exe in vb 6.0 PLz tell me as early as possible. Work Hard and Test your Luck
See Api PostMessage Oberdan