Larger electrical items like laptops have to go through security in separate trays to your bag. You may also have to show it running to security.
As for in-flight, it varies between airlines - usually it's ok as long as it's not during take off or landing and all WiFi and bluetooth options are turned off. It's best to check with cabin crew before using it.
Some airlines have banned the use of laptops with Sony batteries (this can include some IBMs and Macs IIRC) as there were reports of them catching fire a while ago.