OK, not sure how old your post is, but I had exactly the same problem on my daughter's laptop, which had recently been upgraded to W7 Ultimate, so all I did was this:
Right click on the shortcut to Sims2, choose Properties.
Click on the compatability tab, make sure the "run this program in compatability mode for: is OFF
Click on shortcut tab, make sure the 'target' has a speach mark at the front and end, i.e. "C:Program...blahblah"
and add one space and -w after the last speach march, so will look like this "C:Prog...blahblah" -w
This allows the program to run in windowed mode and stops the error of directx9.0 c happening!
Hope that helps?
Cheers,
Jcp