Nov 192008

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!

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. 😉

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.