# win32 mouse tracking

This topic is 4589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm working on mouse-over tracking in my windows app, and for some reason things are not working when they should be. Most basic symptom is the creation of a : TRACKMOUSEEVENT structure. I get an undeclared identifier. Now, I am using VC++6.0, which is 5 years old now, and the MSDN says this is for OS's greater than win98, NT, so I am at a loss. I am including "windows.h" as it says. My app is multithreaded, but that should make no difference. Should I be setting / changing any compiler options here? Thanks.

##### Share on other sites
Well, I'd suggest you get your cursor over to TRACKMOUSEEVENT press F1 and see if you need to include anything else. The windows header is not a be-all end-all include. Also check to see if you've #defined WIN32_LEAN_AND_MEAN. That leaves out some stuff, presumably to make the program quicker.

Edit: Ok, my bad, I didn't read your post that carefully the first time. Do check out the WIN32 #define though.

##### Share on other sites
Thanks, but no dice. Taking out the lean_and_mean etc didn't help, and here are my preprocessor definitions :

WIN32,_DEBUG,_WINDOWS,_MBCS

project options :

/nologo /MT /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"Debug/tree_builder.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c

and it's a multithreaded windows app; it's not MFC.

I'd really like to know what I'm missing out, if anyone can help.

And by the way, what is the difference between "windows.h" and "Windows.h"? Just wondering.

##### Share on other sites
windows.h and Windows.h are the same thing. File names are not case-sensitive on Windows. Secondly for TRACKMOUSEEVENT, before including windows.h make sure you #define _WIN32_WINNT to be at least 0x0400. That is your code might look like this

#define _WIN32_WINNT 0x0400...#include <windows.h>

If you are using TME_NONCLIENT then you'll need to use 0x0500 instead of 0x0400.

##### Share on other sites
thank you! Man, that is why I love this place. For other reference, I was looking here in the msdn, but had not put 2 + 2 together until your post. Cheers.

##### Share on other sites
As a word of warning, the MSDN is not very good about telling you which of the _WIN32_* macros you are supposed to be using. There have been a few times when what was implied by the documentation was not the correct macro. I have found that it is best to go into the header that declares the function/structure/whatever and look at what macro needs to be defined yourself.

##### Share on other sites

This topic is 4589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628730
• Total Posts
2984423

• 25
• 11
• 10
• 16
• 14