I believe rgdwPOV
is what you're after. I'm assuming you've created your device, SetDataFormat(&c_dfDIJoystick2)
and Acquired it.
I shift the state of the DPADs into a 16-bit int so that each bit represents 1 of the directions in each of the DPADs, 4-bits for each DPAD (up,down,left,right).
Here's an example in C++:
DIJOYSTATE2 DeviceState;
HRESULT hr = DIDevice->GetDeviceState(sizeof(DIJOYSTATE2), &DeviceState);
uint16_t rgdwPOV = 0;
for (int i = 0; i < 4; i++) { // In banks of 4, shift in the sate of each DPAD 0-16 bits
switch (DeviceState.rgdwPOV[i]) {
case 0: rgdwPOV |= (byte)(1 << ((i + 1) * 0)); break; // dpad[i]/up, bit = 0
case 18000: rgdwPOV |= (byte)(1 << ((i + 1) * 1)); break; // dpad[i]/down, bit = 1
case 27000: rgdwPOV |= (byte)(1 << ((i + 1) * 2)); break; // dpad[i]/left, bit = 2
case 9000: rgdwPOV |= (byte)(1 << ((i + 1) * 3)); break; // dpad[i]/right, bit = 3
}
}