Mouse programming problems?

I am trying to use TrackMouseEvent() for tracking the mouse. I am getting an undefined error when I try to use the function and I am including the right header files.

winuser.h
windows.h

I am linking with User32.lib and comctrl.lib.

These are all files I can see that are required according to MSDN. Any one no what my proplem is?

Thanks

Comments

  • : I am getting an undefined error

    What's the error?

    Cheers,
    Eric

    BTW: try putting 'windows.h' before 'winuser.h'

  • : : I am getting an undefined error
    :
    : What's the error?
    :
    : Cheers,
    : Eric
    :
    : BTW: try putting 'windows.h' before 'winuser.h'
    :
    :

    error is

    error C2065: 'TrackMouseEvent' : undeclared identifier

    windows.h is before winuser.h

    Any ideas?

  • : error is
    :
    : error C2065: 'TrackMouseEvent' : undeclared identifier
    :
    : windows.h is before winuser.h
    :
    : Any ideas?

    Not really. Don't have MSVC handy, and the code compiles without problem in Borland C++. Are you aware that this function is not available in 95, only 98 and above? Could be part of the problem.

    Cheers,
    Eric


  • : : error is
    : :
    : : error C2065: 'TrackMouseEvent' : undeclared identifier
    : :
    : : windows.h is before winuser.h
    : :
    : : Any ideas?
    :
    : Not really. Don't have MSVC handy, and the code compiles without problem in Borland C++. Are you aware that this function is not available in 95, only 98 and above? Could be part of the problem.
    :
    : Cheers,
    : Eric
    :
    :
    :
    [blue]From MSDN:
    ===========================================
    Requirements
    Windows NT/2000/XP: Included in Windows NT 4.0 and later.
    Windows 95/98/Me: Included in Windows 98 and later.
    Header: Declared in Winuser.h; include Windows.h.
    Library: Use User32.lib.
    ===========================================
    So, you better not be doing it for Win95... Also, 'winuser.h' is INSIDE 'windows.h', so no need to puff up the code.[/blue]

  • either do this:
    #define _WIN32_WINNT 0x0400
    #include

    or better yet, use _TrackMouseEvent which works on all platforms.

    : : : error is
    : : :
    : : : error C2065: 'TrackMouseEvent' : undeclared identifier
    : : :
    : : : windows.h is before winuser.h
    : : :
    : : : Any ideas?
    : :
    : : Not really. Don't have MSVC handy, and the code compiles without problem in Borland C++. Are you aware that this function is not available in 95, only 98 and above? Could be part of the problem.
    : :
    : : Cheers,
    : : Eric
    : :
    : :
    : :
    : [blue]From MSDN:
    : ===========================================
    : Requirements
    : Windows NT/2000/XP: Included in Windows NT 4.0 and later.
    : Windows 95/98/Me: Included in Windows 98 and later.
    : Header: Declared in Winuser.h; include Windows.h.
    : Library: Use User32.lib.
    : ===========================================
    : So, you better not be doing it for Win95... Also, 'winuser.h' is INSIDE 'windows.h', so no need to puff up the code.[/blue]
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories