Detect Window Open event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way in .NET via WMI, Win32API or other mechanism to detect when a Windows form is opened?

My specific need is to detect when the New Hardware Wizard Found form is opened. My hope is that I can capture a WMI event that will tell me when the form is opened so that I can minimize the current application and allow the user to focus on the wizard. Then I will need to know when the form is closed so that I can restore the current application back to its original state

Any help would be appreciated

Thanks, Matt M.
 
Hi Matt,

Take a look at the FindWindow Win32 API. You can use Spy++ to find out the
class name of the window for use in the API call.

Gary

Matt M. said:
Is there any way in .NET via WMI, Win32API or other mechanism to detect when a Windows form is opened?

My specific need is to detect when the New Hardware Wizard Found form is
opened. My hope is that I can capture a WMI event that will tell me when
the form is opened so that I can minimize the current application and allow
the user to focus on the wizard. Then I will need to know when the form is
closed so that I can restore the current application back to its original
state.
 
Gary

Awesome, thanks f or the tip

----- Gary Milton wrote: ----

Hi Matt

Take a look at the FindWindow Win32 API. You can use Spy++ to find out th
class name of the window for use in the API call

Gar

Matt M. said:
Is there any way in .NET via WMI, Win32API or other mechanism to detec when a Windows form is opened
opened. My hope is that I can capture a WMI event that will tell me whe
the form is opened so that I can minimize the current application and allo
the user to focus on the wizard. Then I will need to know when the form i
closed so that I can restore the current application back to its origina
state
 
Back
Top