General information
Category:
Windows API functions
Title:
Close Another Application
I have followed the instructions in the KB #449 from George Tasker to close another application from within VFP.
#DEFINE WM_DESTROY 0x0002
#DEFINE WM_CLOSE 0x0010
DECLARE INTEGER SendMessage IN Win32API;
INTEGER hwnd, INTEGER uMsg,:
INTEGER wParam, INTEGER lParam
* lnhWnd is the Window handle to close
* Close and allow prompt to save changes
= SendMessage(lnhWnd, WM_CLOSE, 0, 0)
* Close without allowing prompt
= SendMessage(lnhWnd, WM_DESTROY, 0, 0)
I use Is_run function to get the window handle.
But I still have problem because the application is not removed completely from Windows task list and Windows task bar, its window is still on the taskbar and also in the task list, so I have to do one more step that is Ctrl-Alt-Del and End Task to close the application window.
Thanks for your help,
Regards,
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only