I would be reluctant to lock doors and windows in case of a fire and he gets trapped. I agree with the other poster, have a good bedtime routine, ignore his whinging and keep putting him back to bed. If he sleeps during the day then cut it out. I know if my kids sleep during the day then they are up half the night. A night light might help as he could be scared of the dark.
Thanks for the replies - but I do all that already - he has a good routine and a night light - even though its darker in the hallway. He doesn't whinge - he just comes out of his room and lays down putting his blanket on top of him and goes to sleep. I don't even notice unless I go upstairs to check. I put him in his bed and then by morning he's back out on the floor fast asleep! Maybe he's just a strange child. I have now taken the lock of his door because I felt cruel doing it.