quote:
Originally posted by novolo
so, that function will work as it is in plus script...
The example shown is not tested, but gives you an idea of what would be involved.
Also, the given VB example in that link posted by Matty (which I gave to him among other links) is a nice example but the code contains a few useless things and also lacks the part where you actually try to close the application in a not forcefull way as you should always do that first.
quote:
Originally posted by novolo
now, in the script documentation, does it say whats the hWnd and how to know what app has wich hWnd?
No, as that should be common programming knowledge. The Scripting Documentation is meant to give info on the Messenger Plus! objects and stuff, it isn't a general "how do I program" tutorial. A Window handle (hWnd) is unique for each
window, an application can have many windows, or even no windows at all. And these window handles are not fixed numbers, they are assigned and removed on the fly and thus change each time.
To know the window handle for a given process name you need a bunch of other code. Note that different processes can have the same name, so you should loop them all. And also, note that a single process/application can contain many windows, and you will never know what window is the main window. So in fact you even need to get all window handles for a given module and process them all (in order to let the application close properly first, before forcing the process to close).