Home > Windows API > How to find information about mouse?

How to find information about mouse?

Well I’m not talking about the one that your cat runs after but the one on which your palm rests. 😉 It’s quite easy, use GetSystemMetrics and associated mouse indexes. I’ll show demos here…

Is there a mouse installed?

// Use GetSystemMetrics
::GetSystemMetrics( SM_MOUSEPRESENT );

Is there a mouse wheel present?

// Use GetSystemMetrics
// There is one more index present called SM_MOUSEHORIZONTALWHEELPRESENT, check out and tell me!
::GetSystemMetrics( SM_MOUSEWHEELPRESENT );

Count of mouse buttons?

// Use GetSystemMetrics
// You can also use this method to test presence of a mouse
::GetSystemMetrics( SM_CMOUSEBUTTONS );

Quite handy right? Most windows developers knows these but hey just in case you missed out. 😉

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: