in reply to How to close an application window in Background?

pradeep,krishna:

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.

  • Comment on Re: How to close an application window in Background?

Replies are listed 'Best First'.
Re^2: How to close an application window in Background?
by pradeep,krishna (Scribe) on Mar 20, 2014 at 11:45 UTC

    Dear friend roboticus
    As i have mentioned its a drawback as it closes only foreground windows, I mean that I want to close the windows in background also(I apologize you as I did not mention this) I don't want to disturb the fore ground windows as i am scheduling my script after converting it to executable file. So as it starts its job in background i want none of the foreground processes to be disturbed.
    Thanks for your valuable time.. :)