views:

316

answers:

1

I have an EXE (app.exe) that calls a COM exposed method in a C# DLL (lib.dll). Lib.dll shows a dialog box.

How do I make the dialog box (not a windows message box) recognize the app.exe as the owner, so that when app.exe is minimized, so is the dialog from lib.dll?

The dialog cannot be modal.

Is this a problem that can be solved with Winforms? I prefer a Winforms solution, but will be satisfied with a XAML solution if necessary.

+2  A: 

I assume your C# Dll is just creating an instance of a form and calling the .Show() method. If that is the case, in your COM exposed method should take an hWnd parameter and set the forms owner to that hWnd.

Nate Bross
duh... of course! Sorry about that. ;)
Jason