Information générale
Catégorie:
Fonctions Windows API
Titre:
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,
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement