Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Close Another Application
Message
 
To
03/04/2000 04:10:29
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00354201
Message ID:
00354254
Views:
25
>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,

Clarissa,

First, you have to locate the parent window handle and use that. Second, if you're dealing with an OLE Automation Server, such as MS Word, it's better to use the appropriate syntax connected with the server to close it down. Servers can be tricky in that somtimes more than a single instance of a program is created. For example, with the Office 2000 applications, opening multiple documents actually opens multiple windows.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform