Then use the SetForegroundWindow function to bring each window to the foreground before trying to close the window. You're already specifying the function in your use statement, so use it.
I find it remarkable that your post shows that you know the existence of the function, and you know that you can't close the window because it's not in the foreground.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: How to close an application window in Background?
by roboticus
in thread How to close an application window in Background?
by pradeep,krishna
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |