Presentation is loading. Please wait.

Presentation is loading. Please wait.

Douglas Boling President Boling Consulting Inc. SESSION CODE: WEM304.

Similar presentations


Presentation on theme: "Douglas Boling President Boling Consulting Inc. SESSION CODE: WEM304."— Presentation transcript:

1 Douglas Boling President Boling Consulting Inc. SESSION CODE: WEM304

2

3

4

5

6

7

8

9 //------------------------------------------------- // DoCreateMain - Process WM_CREATE message // LRESULT DoCreateMain (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { EnableGestures (hWnd, TGF_GID_ALL, TGF_SCOPE_PROCESS); return 0; }

10

11 typedef struct tagGESTUREINFO { UINT cbSize;// Size of structure DWORD dwFlags;// GF_BEGIN/GF_INERTIA/GF_END DWORD dwID;// Gesture ID HWND hwndTarget;// Target Window handle POINTS ptsLocation;// Location of gesture DWORD dwInstanceID;// Reserved DWORD dwSequenceID; // Timestamp of Gesture ULONGLONG ullArguments; // Args. See next slide UINT cbExtraArguments; // Possible extra data } GESTUREINFO, *PGESTUREINFO;

12

13

14

15

16

17 typedef struct tagWAGI { size_t cbSize; // Size of structure DWORD dwFlags; // See next slide UINT nOwnerAnimateMessage; // ID of WM_USER msg or 0 UINT nAnimateStatusMessage; // ID of WM_USER msg or 0 HBRUSH hExtentBrush; // Reserved UINT nItemHeight; // Used for snapping to item UINT nItemWidth; // Used for snapping to item BYTE bHorizontalExtent; // Scroll ext past last item BYTE bVerticalExtent; // Scroll ext past last item } WAGINFO, *LPWAGINFO;

18

19

20

21

22 typedef struct tagPHYSICSENGINEINIT { DWORD cbSize; // Size of the structure DWORD dwEngineType; // Reserved, set to zero DWORD dwFlags; // Specifies system or User time base LONG lInitialVelocity; // Initial velocity in Pixels/sec DWORD dwInitialAngle; // Angle in radians BYTE bXAxisMovementMode; // Horz movement action (Decelerate only opt) BYTE bXAxisBoundaryMode; // Horz boundary action. Bounce/rubber band/None BYTE bYAxisMovementMode; // Vert movement action (Decelerate only opt) BYTE bYAxisBoundaryMode; // Vert boundary action. Bounce/rubber band/None RECT rcBoundary; // Entire movement rectangle SIZE sizeView; // Rectangle of visible region POINT ptInitialPosition; // Initial position in region SIZE sizeItem; // Size of item. Used to snap to item boundary } PHYSICSENGINEINIT; HRESULT CreatePhysicsEngine(PHYSICSENGINEINIT* pEngineInit, HPHYSICSENGINE* phResult);

23

24 if (gi.dwFlags & (GF_INERTIA | GF_END)) { PHYSICSENGINEINIT pei; memset (&pei, 0, sizeof (pei)); pei.cbSize = sizeof (pei); pei.dwFlags = 0; pei.lInitialVelocity = GID_SCROLL_VELOCITY (gi.ullArguments); pei.dwInitialAngle = GID_SCROLL_ANGLE (gi.ullArguments); pei.bXAxisMovementMode = PHYSICSENGINE_MOVEMENT_MODE_DECELERATE; pei.bXAxisBoundaryMode = PHYSICSENGINE_BOUNDARY_MODE_RUBBERBAND; pei.bYAxisMovementMode = PHYSICSENGINE_MOVEMENT_MODE_DECELERATE; pei.bYAxisBoundaryMode = PHYSICSENGINE_BOUNDARY_MODE_RUBBERBAND; pei.rcBoundary = g_rcWork; pei.sizeView.cx = rectImg.right; pei.sizeView.cy = rectImg.bottom; pei.ptInitialPosition.x = gi.ptsLocation.x; pei.ptInitialPosition.y = gi.ptsLocation.y; pei.sizeItem.cx = 1; pei.sizeItem.cy = 1; hr = CreatePhysicsEngine (&pei, &g_hPEAnimate); SetTimer (hWnd, ID_ANIMATE, 100, NULL); }

25 case WM_TIMER: if (wParam == ID_ANIMATE) { // Query physics engine PHYSICSENGINESTATE state; memset (&state, 0, sizeof (state)); state.cbSize = sizeof (state); QueryPhysicsEngine (g_hPEAnimate, &state); // Update image MoveImg (hWnd, state.ptPosition); // If animation complete, clean up if (state.fComplete) { DestroyPhysicsEngine (g_hPEAnimate); KillTimer (hWnd, 1); } break;

26

27

28

29 Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub.

30

31

32 www.microsoft.com/teched www.microsoft.com/learning http://microsoft.com/technet http://microsoft.com/msdn

33

34 Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31 st http://northamerica.msteched.com/registration You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year

35

36


Download ppt "Douglas Boling President Boling Consulting Inc. SESSION CODE: WEM304."

Similar presentations


Ads by Google