I don't know about earlier Windows, but Windows 8 does not attempt to defragment drives that identify themselves as being solid-state. It does invoke TRIM on drives that advertise that feature, and confusingly, this is done through the same defragmentation UI.