Get Mouse Position in Thread

I have a non-interface or worker thread that I would like to acquire the mouse position.  I tried GetMessagePos, but that only returns NULL.  I'm assuming this is because my thread has no message pump.

Is the only way to get the mouse position to create message pump?  Would a thread message pump work?  Can I "hook" myself into something to acquire the info?  Why isn't there a function just called DWORD GetMousePos()?!?!?

There is a function, "GetMouseMovePointsEx" which retrieves history of mouse points, but it looks like it needs a mouse point from WM_MOUSEMOVE, so no go there... plus you have to have WINVER >= 0x0500 which sucks.  

All I want is the current mouse position.  Any info would be great, thanks!
toddmooreAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nils pipenbrinckCommented:
I think GetCursorPos will do the job.. Ood naming. it doesn't give you the position of the cursor but the mouse..

I used it with success..

nils
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
toddmooreAuthor Commented:
Thanks, it works!  I looked ALL over MSDN for that answer.  Geez!
0
toddmooreAuthor Commented:
Thanks, it works!  I looked ALL over MSDN for that answer.  Geez!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.