Ideally (for me) I want to be able to send a message to another app that mimics a windows-shutdown-message so the app will close its files & exit.
If that's not possible, I can be a shell that runs it, then just terminates it; but I really want to be sure it's file buffers are all flushed .
Any ideas?
thanks.
Request that another app shuts down.
Re: Request that another app shuts down.
Try to send a close message:
Usually this should work (theres also #WM_QUIT).
Code: Select all
SendMessage_(WindowHandle.i,#WM_CLOSE,#Null,#Null)
Re: Request that another app shuts down.
Hi jassing
Long time no see
Long time no see
Code: Select all
SendMessage_(#HWND_BROADCAST, #WM_SYSCOMMAND, #SC_CLOSE, hWnd)
Egypt my love
Re: Request that another app shuts down.
Thanks; indeed it has been a while. I moved & took a little time off from Windows work...RASHAD wrote:Hi jassing
Long time no see
Hope you have been well.
RASHAD wrote:Code: Select all
SendMessage_(#HWND_BROADCAST, #WM_SYSCOMMAND, #SC_CLOSE, hWnd)
Thanks; I'll give those three a try. I fear the app I am trying to close gracefully isn't listening. I am trying to close an inventory & billing app down so that it's data file can be backed up at night. The problem is the app doesn't appear to flush its file buffers to disk, so if I kill the app, the data file doesn't contain some of the last updates...Mijikai wrote:Try to send a close message:Usually this should work (theres also #WM_QUIT).Code: Select all
SendMessage_(WindowHandle.i,#WM_CLOSE,#Null,#Null)
I appreciate the quick replies. Thanks!
Re: Request that another app shuts down.
I've found the #SC_CLOSE version is better than #WM_CLOSE, because #WM_CLOSE wouldn't close some windows on my PC (but #SC_CLOSE did).
[Edit] Here's my previous post about it: viewtopic.php?p=509365#p509365
[Edit] Here's my previous post about it: viewtopic.php?p=509365#p509365
Last edited by Dude on Mon Oct 01, 2018 3:55 am, edited 1 time in total.
Re: Request that another app shuts down.
I guess it's all a matter of what the app is listening for, conventions are there for a reason, but it doesn't mean apps have to follow them.Dude wrote:I've found the #SC_CLOSE version is better than #WM_CLOSE, because #WM_CLOSE wouldn't close some windows on my PC (but #SC_CLOSE did).