My PILs have done this all the years I have known them (30 ish). I hate it, and they know I hate it. They used to just let themselves in (door not usually locked if we were in), then we started locking the door, and they accused us (me, really) of being rude for locking the door! 
Some years ago, dh had it out with them, and they agreed to ring first (but were huffy about it). Usually they then rang when no more than 5 minutes away, so only time to dress, or chuck mess in cupboards, or whatever. On one memorable occasion they rang when we were in bed (early weekend morning), from our driveway!
We recently moved house. Not much further away, but not on their route anywhere! Things seem to have improved. Also MiL is now in poor health, and I think she was worse than FIL for this, so they don't turn up as much.
No real solution though. They are both thick skinned and easily offended, if that is possible! They have never had a key to any of our houses over the years, despite them constantly asking for one. I have tried not answering the door, but they are very persistent and not easily put off.
I just hope to outlive them. I look forward to the peace I will then enjoy!
And I am now bending over backwards to never do his to my grown up children. Probably to an extreme. They probably think I never want to see them!