Sign in to follow this  
squirrel_of_death

win32 mouse tracking

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 this post


Link to post
Share on other sites
moucard    161
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 this post


Link to post
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 this post


Link to post
Share on other sites
Colin Jeanne    1114
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 this post


Link to post
Share on other sites
Colin Jeanne    1114
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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this