Jimekus
1/26/2012 9:01:00 PM
On Jan 27, 8:56 am, "Bob Butler" <bob_but...@cox.invalid> wrote:
> "Jeff Johnson" <I....@enough.spam> wrote in message
>
> news:jfs7ra$rp8$1@dont-email.me...
>
>
>
>
>
>
>
>
>
> > "Bob Butler" <bob_but...@cox.invalid> wrote in message
> >news:jfs4hl$7hh$1@dont-email.me...
>
> >>I have a need in an app to have 2 unrelated windows such that if both are
> >>behind other apps and the user brings one to the foreground the other
> >>stays hidden. To demo the problem create a new project with 2 forms and
> >>in Form1 add this:
>
> >> Private Sub Form1_Load()
> >> Form2.Show
> >> End Sub
>
> >> Run the project and you get 2 forms displayed. Start something else like
> >> Explorer and the 2 forms will be behind the new app but still showing on
> >> the taskbar. Click either Form1 or Form2 on the taskbar and both forms
> >> will jump to the front. I'm drawing a blank on how to unlink them so
> >> that they behave independently. Is it even possible without using
> >> CreateWindow to make the second form so it isn't owned by the hidden
> >> master window?
>
> > Just pulling this out of my ass: SetWindowParent() to 0? (Assuming that
> > API call even exists. You get the gist, I'm sure.)
>
> That was my first thought and I tried using SetParent to GetDesktopWindow()
> but it made no difference; I'm guessing it's the owner, not the parent, that
> is causing this.
You could try setting the border style to none and they will not show
in the taskbar. Then you can create another mouse/mechanism for
bringing them to the front. Forms of this type are notorious for
acting independently and since moving my development over to Windows
7, some of my forms of this type are disappearing unpredictably.