max
max

Reputation: 1060

Retrieving joystick name with win32 api

I have a joystick plugged in. It has a name string "My 50cent Joystick" that shows up if I go to Game Controllers under the Control Panel on Vista. I want to retrieve this string programmatically. After some research I found joyGetDevCaps that can retrieve a lot of information except the name string. Under szPname I get "Microsoft Pc Joystick driver" and under some information. Under szOEMVxD array i get what looks like "pc joystick driver" surrounded by random characters. How do I get the name that shows up under the control panel?

Upvotes: 1

Views: 1769

Answers (1)

veefu
veefu

Reputation: 2890

Hmm...

Perhaps try enumerating the joysticks on the system. The DIDEVICEINSTANCE that gets passed to your callback function might have the string you're looking for in its tszInstanceName or tszProductName fields.

Upvotes: 3

Related Questions