2

I am using a library ( *.dll ) that keeps popping out a window ( which appears as an application in the task manager ) , like "are you sure?..." Yes/No when a certain function is executed.

Is there some way to automatically detect this window/form/application being opened and to close it?

Thanks!

Roger
  • 6,443
  • 20
  • 61
  • 88
  • 3
    Usually programs ask for confirmation when you're about to do something destructive. Why would you want to stop that check? – Ken White Mar 10 '11 at 18:05
  • 1
    @Ken White: Probably to workaround the fact that the OP has a DLL that decided in should show popup windows, which is likely not a good idea. – Ed S. Mar 10 '11 at 18:07
  • since I know what I want to program to do and, moreover, since I'm doing it in a loop, its bugging me when I have to keep pressing 'yes' all the time, until it goes though the loop. :) so I want to somehow be able to detect this window appearing ( it appears in TaksManager/Applications , btw ) and automatically hit 'yes'. – Roger Mar 10 '11 at 18:09

1 Answers1

0
`button.performclick` - 

http://msdn.microsoft.com/en-us/library/system.windows.forms.button.performclick.aspx

Kumar
  • 997
  • 5
  • 8
  • 1
    Dialog != Form. I have a hunch we're dealing with the former here. – Grant Thomas Mar 10 '11 at 18:06
  • Yes, we're dealing with a new form, now a dialogue. :) – Roger Mar 10 '11 at 18:13
  • @Kumar: If that were possible, it would seem the _work around_ would be to use no window at all. – Grant Thomas Mar 10 '11 at 18:28
  • yea thats right, but according to poster he says he knows what he is coding for, not sure what is the problem situation he dealing with. – Kumar Mar 10 '11 at 18:30
  • the problem is that a library .dll keeps popping a window, that I need to somehow get automatically closed. – Roger Mar 10 '11 at 18:41
  • look into this might help - http://stackoverflow.com/questions/2517295/winforms-how-to-determine-if-window-is-no-longer-active-no-child-window-has-foc – Kumar Mar 10 '11 at 18:50
  • -1 `button.performClick` works fine if it's in your own application, where you have access to 'button' directly. You don't have in a DLL, though, so this won't work (if the OP had direct access to `button', there wouldn't be a need to ask this question). – Ken White Mar 11 '11 at 00:13