Detect Window Open event

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.
 
G

Gary Milton

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top