gdi32: Use HandleToULong inline function to convert handle to index instead of casting.