dotnet windows forms:
Hi Bob,
did you add to your form a notifyIcon control ? cos this control handels the
systray for .NET.
hope that helps
[quoted text, click to view] "Bob" <rjl@baysidetech.com> wrote in message
news:1117543981.353871.191270@o13g2000cwo.googlegroups.com...
> All,
>
> I have been trying to come up with a work around for the default form
> minimization process in .net. Currently, when you minimize a form it
> animates the minimization to the bottom left. This is fine, unless you
> are trying to minimize to the systray. Below is a snippet of code I
> wrote (copied from Kollen) but I must be doing something wrong cause I
> a get is a hidden form and no minimization animation. Any help would
> be appreciated.
>
> Private Sub AnimateToSysTray()
>
> Me.Hide()
> 'Animate hiding to the system tray
> Dim _rect As Rectangle = Me.DesktopBounds
> Dim _from As RECT
> Dim _to As RECT
>
>
> With _from
> .Top = _rect.Top
> .Left = _rect.Left
> .Bottom = _rect.Bottom
> .Right = _rect.Right
> End With
>
> Dim hWndP As System.IntPtr = FindWindow("Shell_TrayWnd",
> vbNullString)
> Dim hWndC As System.IntPtr = FindWindowEx(hWndP,
> System.IntPtr.Zero, "TrayNotifyWnd", vbNullString)
> If Not (IntPtr.Zero.Equals(hWndC)) Then
> GetWindowRect(hWndC, _to)
>
> Else
> ' Default to bottom right of screen if something goes wrong
>
> _to.Left = SystemInformation.VirtualScreen.Right - 118
> _to.Top = SystemInformation.VirtualScreen.Bottom - 30
> _to.Right = SystemInformation.VirtualScreen.Right
> _to.Bottom = SystemInformation.VirtualScreen.Bottom
> End If
> DrawAnimatedRects(Me.Handle, IDANI_CAPTION, _from, _to)
>
> End Sub
>
>
> -b
>