Use Gap and crack sealant on the window sill
If the product your talking about is GreatStuff (which it sounds like it is), you'll want to use the window and door variety instead.  

The gap and crack formula expands too much, whereas the window and door stuff doesn't expand as much.