views:

70

answers:

1

I have two applications having two different top level windows:

App1 -- Window1
App2 -- Window2

Now, I am creating a Dialog Dlg1 in App1 and I want to set window2(App2) as a parent window. ( That is because I want my Dlg1 to come on top of Window2 ).

I created the dialog by setting Window2 as parent. It worked. But is it the correct way? Is there any known issues\restrictions in setting parent across process? I checked windows documentation and found not much information.

+4  A: 

This is more or less supported and it does work with some restrictions. You will need to be careful that the two processes are running as the same user, and that you have no security or elevation issues that would prevent the two processes communicating. Secondly, you may run into issues if the window in question has some inbuilt assumptions about which window is the parent - this is less of an issue if you have created both processes.

Although I just read what you said here:

That is because I want my Dlg1 to come on top of Window2

This sounds kind of morally and technologically dicey. What happens if the author of the first program objects? Might you not get into some kind of war between the two windows? If this is all you are trying to do, why not just set your window as TOPMOST or TOP and leave it at that?

1800 INFORMATION
Thanks for the answer. Since I am the owner of both the windows the issue of moral dicey won't arise.
aJ