The free space has to be at the end of the volume, so you'll need to shift D: to the left and then resize it over the free space that will be to the right.

Vista's Disk Management tool is particularly tricky when trying to shrink a volume that has unmovable data scattered across it.