in reply to Re: Killing an Application in Windows NT
in thread Killing an Application in Windows NT

I have to also recommend proper licensing for the application you have (presumably) agreed to use under the author's terms.

As previously mentioned, a window and a process are not the same thing. and you're really looking to control the window, not the app that generated it.

I have done some Win32 hacking along these lines, and the specific thing you're looking for is a "Window Handle", usually called (in Windows API docs) hWnd. There is a Win32 API call to find a window's handle, given its name. The title of the message window hopefully doesn't change from run to run, so you can use that to get a handle on the window. From there you have a few choices, depending on what you have Perl modules for:

1. You could send the window a 'close' message
2. You could find the handle for the (probably) only button on the window and send it a 'click' message
3. You could ask the window for its position on the screen, and then move the mouse to the appropriate offset from that position; then click the mouse. I think the Win32::CtrlGUI module mentioned above can do this.

--
Spring: Forces, Coiled Again!
  • Comment on Re: Re: Killing an Application in Windows NT

Replies are listed 'Best First'.
Re: Re: Re: Killing an Application in Windows NT
by BrowserUk (Patriarch) on Dec 18, 2003 at 22:05 UTC

    Um. It makes more sense to respond to the original post rather than to a reply that has already said the same things you are saying?


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!