Click here to Skip to main content
15,884,237 members
Articles / Programming Languages / C++
Article

MousePos

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

Introduction

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!

License

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


Written By
Web Developer
China China
Hi,I'm YangTze!

Comments and Discussions

 
GeneralAwesome~Thx~! Pin
Arthurchu23-Oct-07 15:30
Arthurchu23-Oct-07 15:30 
GeneralI WANT TO ADD CLICK Pin
syamak14-Jun-04 22:47
syamak14-Jun-04 22:47 
Generalsensor of the mouse Pin
dnqhung2-Jun-04 18:11
dnqhung2-Jun-04 18:11 
GeneralA little bug I find in MousePos in the function "HFONT MyCreateFont()" Pin
soke8-Dec-03 14:01
soke8-Dec-03 14:01 
General@_@ Pin
YangTze9-Dec-03 21:41
YangTze9-Dec-03 21:41 
GeneralThanks! Pin
YangTze10-Jun-04 15:36
YangTze10-Jun-04 15:36 
QuestionHow Can I make the window transparent? Pin
Aymen++29-Nov-02 12:14
Aymen++29-Nov-02 12:14 
GeneralPretty Good!! Pin
WREY9-Sep-02 0:48
WREY9-Sep-02 0:48 
Generalvery good Pin
Member 12879144-Sep-02 19:15
Member 12879144-Sep-02 19:15 
GeneralGood Job Pin
msousa29-Aug-02 9:16
msousa29-Aug-02 9:16 
GeneralRe: Good Job Pin
YangTze29-Aug-02 16:44
YangTze29-Aug-02 16: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.