Click here to Skip to main content
15,126,221 members
Articles / Programming Languages / C++
Posted 25 Aug 2002


21 bookmarked


Rate me:
Please Sign up or sign in to vote.
4.79/5 (17 votes)
25 Aug 2002
A mouse tracking window that displaying the current mouse position or current local time.


The "MousePos" is a Win32 SDK application that displays the current mouse position or current local time inside a window (looks like ToolTip) which follows the mouse cursor

I get the Current Mouse Position or Current Local Time inside WM_TIMER processing switch/case, then format this information as a string using the Win32 API function GetTextExtentPoint32 to calculate the size that the string will occupy in the displaying window.

You can click the "MousePos" button on the Windows Taskbar to popup it's menu, switch the displaying mode or change the displaying background/font & color.

So, with this demo you can develop your own variation on the Mouse cursor!.

Thank you for your viewing this article!


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
China China
Hi,I'm YangTze!

Comments and Discussions

GeneralAwesome~Thx~! Pin
Arthurchu23-Oct-07 16:30
MemberArthurchu23-Oct-07 16:30 
syamak14-Jun-04 23:47
Membersyamak14-Jun-04 23:47 
Generalsensor of the mouse Pin
dnqhung2-Jun-04 19:11
Memberdnqhung2-Jun-04 19:11 
GeneralA little bug I find in MousePos in the function "HFONT MyCreateFont()" Pin
soke8-Dec-03 15:01
Membersoke8-Dec-03 15:01 
General@_@ Pin
YangTze9-Dec-03 22:41
MemberYangTze9-Dec-03 22:41 
GeneralThanks! Pin
YangTze10-Jun-04 16:36
MemberYangTze10-Jun-04 16:36 
QuestionHow Can I make the window transparent? Pin
Aymen++29-Nov-02 13:14
MemberAymen++29-Nov-02 13:14 
GeneralPretty Good!! Pin
WREY9-Sep-02 1:48
MemberWREY9-Sep-02 1:48 
Generalvery good Pin
Member 12879144-Sep-02 20:15
MemberMember 12879144-Sep-02 20:15 
GeneralGood Job Pin
msousa29-Aug-02 10:16
Membermsousa29-Aug-02 10:16 
GeneralRe: Good Job Pin
YangTze29-Aug-02 17:44
MemberYangTze29-Aug-02 17:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.