Hey guys,
I used the vb.net to c# converter to convert john's formanimator code to csharp.
However, he has this method in his code:
vb.net Code:
'Windows API function used to animate the form. Private Declare Auto Function AnimateWindow Lib "user32" (ByVal hWnd As IntPtr, _ ByVal dwTime As Integer, _ ByVal dwFlags As Integer) As Boolean 'Animates the form automatically when it is loaded. Private Sub m_Form_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles m_Form.Load 'MDI child forms do not support transparency so do not try to use the Blend method. If Me.m_Form.MdiParent Is Nothing OrElse Me.m_Method <> AnimationMethod.Blend Then 'Activate the form. Me.AnimateWindow(Me.m_Form.Handle, _ Me.m_Duration, _ Me.AW_ACTIVATE Or Me.m_Method Or Me.m_Direction) End If End Sub
and the associated variables + their types:
vb.net Code:
Public Enum AnimationDirection Right = &H1 Left = &H2 Down = &H4 Up = &H8 End Enum Public Enum AnimationMethod Roll = &H0 Centre = &H10 Slide = &H40000 Blend = &H80000 End Enum Private Const AW_HIDE As Integer = &H10000 'Hide the form. Private Const AW_ACTIVATE As Integer = &H20000 'Activate the form. Private m_Method As AnimationMethod 'The animation method used to show and hide the form. Private m_Direction As AnimationDirection 'The direction in which to Roll or Slide the form.
So
now I dont understand how his hexadecimal values are working. The API is expecting an integer for "flags" for its last parameter.
however John is using
Me.AW_ACTIVATE Or Me.m_Method Or Me.m_Direction
which dosnt make sense to me.. what does OR do in this case? adds them up? because i think that the "flags" parameter (which is an int) must contain information about activate/hide, methodoftravel, and direction of travel.
So what does this mean and how can I incorparate it into csharp.
thanks




Reply With Quote