Results 1 to 6 of 6

Thread: need help about WM_MOUSEMOVE

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2005
    Location
    turkey
    Posts
    10

    need help about WM_MOUSEMOVE

    Can anybody tell me how do i get difference of current and the previous position of the wheel.
    From the msdn I have checked and found GET_WHEEL_DELTA_WPARAM Macro but i can't use it.
    Compiler says "GET_WHEEL_DELTA_WPARAM : undeclared identifier"
    I also included windows.h and i am sure that
    case WM_MOUSEMOVE: works well.
    What i am trying to do is to set the A value in
    gluPerspective(A,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
    function. I am trying to zoom in - out by changing A value. Am I on the right way...
    Thanx

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2004
    Location
    Angers, France
    Posts
    245

    Re: need help about WM_MOUSEMOVE

    Hm, personally when i'm sure that the header is included and that normally works I suspect a mistakes in declaration, I suppose that your source is to big to be posted...?
    The .Product will make you .Believe

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2005
    Location
    turkey
    Posts
    10

    Re: need help about WM_MOUSEMOVE

    This is my wndproc function and problem here is
    GET_WHEEL_DELTA_WPARAM(wParam); doesn't work
    in case WM_MOUSEWHEEL

    LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window
    UINT uMsg, // Message For This Window
    WPARAM wParam, // Additional Message Information
    LPARAM lParam) // Additional Message Information
    {
    switch (uMsg) // Check For Windows Messages
    {
    case WM_ACTIVATE: // Watch For Window Activate Message
    {
    if (!HIWORD(wParam)) // Check Minimization State
    {
    active=TRUE; // Program Is Active
    }
    else
    {
    active=FALSE; // Program Is No Longer Active
    }

    return 0; // Return To The Message Loop
    }

    case WM_SYSCOMMAND: // Intercept System Commands
    {
    switch (wParam) // Check System Calls
    {
    case SC_SCREENSAVE: // Screensaver Trying To Start?
    case SC_MONITORPOWER: // Monitor Trying To Enter Powersave?
    return 0; // Prevent From Happening
    }
    break; // Exit
    }

    case WM_CLOSE: // Did We Receive A Close Message?
    {
    PostQuitMessage(0); // Send A Quit Message
    return 0; // Jump Back
    }

    case WM_KEYDOWN:
    //Keyboard_Input();
    switch(wParam)
    {
    case VK_ESCAPE:
    PostQuitMessage(0);
    break;
    }
    break;

    case WM_KEYUP: // Has A Key Been Released?
    {
    keys[wParam] = FALSE; // If So, Mark It As FALSE
    return 0; // Jump Back
    }

    case WM_SIZE: // Resize The OpenGL Window
    {
    ReSizeGLScene(LOWORD(lParam),HIWORD(lParam)); // LoWord=Width, HiWord=Height
    return 0; // Jump Back
    }

    case WM_MOUSEMOVE: // Mouse Move
    {
    // int xPos = GET_X_LPARAM(lParam);
    // int yPos = GET_Y_LPARAM(lParam);
    objCamera.Mouse_Move(640, 480);
    return 0; // Jump Back
    }
    case WM_MOUSEWHEEL:
    {
    short zDelta = GET_WHEEL_DELTA_WPARAM(wParam);

    return 0;
    }



    }


    // Pass All Unhandled Messages To DefWindowProc


    return DefWindowProc(hWnd,uMsg,wParam,lParam);
    }

  4. #4
    Member Contributor
    Join Date
    Mar 2004
    Location
    springfield, va [usa]
    Posts
    65

    Re: need help about WM_MOUSEMOVE

    not to sound like a jerk, but doesn't this belong in the windows-specific thread maybe?

  5. #5
    Senior Member Regular Contributor
    Join Date
    Aug 2004
    Location
    Angers, France
    Posts
    245

    Re: need help about WM_MOUSEMOVE

    yes it can be
    The .Product will make you .Believe

  6. #6
    Junior Member Newbie
    Join Date
    Feb 2005
    Location
    turkey
    Posts
    10

    Re: need help about WM_MOUSEMOVE

    I found what i am asking
    I wrote
    short zDelta = (wParam / 65536);
    in case WM_MOUSEWHEEL
    so i get zDelta as 120 positive or negative according to wheel rotation.

Similar Threads

  1. Mouse Coordinates with WM_MOUSEMOVE
    By burrows111 in forum OpenGL: Windows
    Replies: 5
    Last Post: 02-11-2010, 04:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean