T
TC
Hey Folks,
I am using the following 4 Win32 APIs with a C# AddIn:
FindWindow
SetWindowLong
SetForegroundWindow
EnableWindow
Within the AddIn, there are some winforms. I use these APIs to set them as
the top window in modeless form but only from within the parent app (i.e.
while in the AddIn's parent app, the winforms are on top and modeless but
when moving to another app, the newly activated app is the top window).
For example, on the 'Load' event, I do the following:
SetWindowLong(this.Handle, GWL_HwndParent, this.ParentApp.Handle);
// Disable Outlook window for modal functionality
EnableWindow((IntPtr)this.ParentApp.Handle,false);
EnableWindow(this.Handle,true);
I know that one can set a winform to be a top window but it does it for the
entire desktop.
Is there a way under the .Net Framework to easily achieve the same behavior
accomplished via the APIs?
Thanks & Regards,
TC
I am using the following 4 Win32 APIs with a C# AddIn:
FindWindow
SetWindowLong
SetForegroundWindow
EnableWindow
Within the AddIn, there are some winforms. I use these APIs to set them as
the top window in modeless form but only from within the parent app (i.e.
while in the AddIn's parent app, the winforms are on top and modeless but
when moving to another app, the newly activated app is the top window).
For example, on the 'Load' event, I do the following:
SetWindowLong(this.Handle, GWL_HwndParent, this.ParentApp.Handle);
// Disable Outlook window for modal functionality
EnableWindow((IntPtr)this.ParentApp.Handle,false);
EnableWindow(this.Handle,true);
I know that one can set a winform to be a top window but it does it for the
entire desktop.
Is there a way under the .Net Framework to easily achieve the same behavior
accomplished via the APIs?
Thanks & Regards,
TC