A family member recently discovered that the Power / Lock button on the top of his iPhone was damaged and would no longer register a contact when pressed in. As a result, he was unable to lock his iPhone or even turn the power on and off, so he made an appointment with a Genius at an Apple Store, only to be told that a replacement would run to $149. This would, perhaps, not be the best investment, particularly given that it was an iPhone 4 and was due for an upgrade in two months, so he decided to hold off.
However, the Genius did give one potential fix to this problem, which was free and would tide him over for a couple of months until the purchase of a (rumored!) iPhone 5. The fix was really simple and involved invoking a new ‘Gesture’ which made a small virtual button appear on the iPhone screen. To access it, head into Settings > General > Accessibility > Assistive Touch and toggle it to ‘On’. Hit Create New Gesture and a small white button will appear permanently on your screen, until you turn it off of course.
The button gives you a virtual Home button, and if you select Device, then you can Lock the Screen, control volume, shake the device, rotate the screen etc. You can also position it in several areas around the screen i.e. move it to an innocuous location on the screen. The catch is, if your lock button is completely broken then you can’t allow your device to power off. However, the virtual button will allow locking which is pretty much what you want.
Give it a try now if your button is broken, or if you fancy something different.