in reply to Killing an Application in Windows NT

The problem is that the pop up window is almost certainly not a separate application (or process), but an integral part of the same application. If you were to detect the process id/handle for the task controlling the popup window and kill it, you would be killing the program that produces it, and your overall process would not complete correctly.

That leaves you with two options. Re-licence the application or write a program that 'clicks' the appropriate button on the popup window to cause it to be dismissed.

The former is probably the easiest solution and long term, the right one unless you can find an alternative to it that performs the same job.

The second, is more complicated, but could be done using perl. A good place to start would be Win32::CtrlGUI which will allow your script to look for the specific popup window, and then 'send' a keystroke or mouse click to it. However, working out how to determine which window to look for, and what and where to send the keystroke(s) or mouse clicks to is non-trivial and not something that anyone here could really help you with much unless they had a copy of the same application.

You'll need to read the documentation to the module quite carefully.


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

  • Comment on Re: Killing an Application in Windows NT

Replies are listed 'Best First'.
Re: Re: Killing an Application in Windows NT
by husker (Chaplain) on Dec 18, 2003 at 16:53 UTC
    Similar to the doctor responding to the woman who says "My arm hurts when I do this..", the simple answer is to renew your FlexLM licenses, but this is hardly instructive. Fortunately, it looks like other Monks have provided some wisdom in this area.
Re: Re: Killing an Application in Windows NT
by paulbort (Hermit) on Dec 18, 2003 at 20:51 UTC
    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!

      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!