I am attempting to rewrite someone elses code from VB6 dealing with
creating a floating application bar tool bar since I cannot find a
vb.net equivalent.
Some of the code I am ashamed to admit I do not fully understand so i
am trying to figure it out. here is just one example
' Called when the AppBar receives a WM_MOVING message
Friend Function OnMoving(ByVal lparam As Long) As Long
Dim rc As RECT
Dim pt As POINTS
Dim abEdgeProposed As TAppBarEdge
Dim w As Long
Dim h As Long
' We control the moving of the AppBar. For example, if the mouse
moves
' close to an edge, we want to dock the AppBar
' The lParam contains the window's position proposed by the system
CopyMemory VarPtr(rc), lparam, Len(rc)
' Get the location of the mouse cursor
pt = GetMessagePosition
' Where should the AppBar be based on the mouse position?
abEdgeProposed = CalcProposedState(pt)
If (FabEdgeProposedPrev <> abeFloat) And (abEdgeProposed =
abeFloat) Then
' While moving, the user took us from a docked/autohidden
state to
' the float state. We have to calculate a rectangle location
so that
' the mouse cursor stays inside the window.
rc = FABS.rcFloat
w = rc.Right - rc.Left
h = rc.Bottom - rc.Top
With rc
.Left = pt.X - w \ 2
.Top = pt.Y
.Right = pt.X - w \ 2 + w
.Bottom = pt.Y + h
End With
End If
' Remember the most-recently proposed state
FabEdgeProposedPrev = abEdgeProposed
' Tell the system where to move the window based on the proposed
state
GetRect abEdgeProposed, rc
' Tell our derived class that there is a proposed state change
OnAppBarStateChange True, abEdgeProposed
' Tell the system the new rectangle
CopyMemory lparam, VarPtr(rc), Len(rc)
' Trap default processing
OnMoving = 0
End Function
On Wed, 29 Nov 2006 14:33:53 +0100, "Herfried K. Wagner [MVP]"
[quoted text, click to view] <hirf-spam-me-here@gmx.at> wrote:
>VarPtr