How do I know if a house built in 1940 in Ontario, Canada has lead pipes?
Step one - look. Lead is unlikely inside the house, but you might see a lead pipe coming in from the street, if there is one. Copper pipes soldered with tin/lead solder are pretty common. But so are threaded galvanized iron pipes.

Step two - ask the water supplier, if it's on a municipal system. 

Step three - have the water tested - it won't tell you if the pipes or solder have lead, but it will tell you if you need to worry about it. Most municipal systems that have lead distribution pipes in service take care to adjust the water chemistry so the lead stays in the pipes, not in the water.

If it's on a well, the odds of lead pipes go way down, IME. But the odds of water chemistry that might release lead go up quite a bit, depending on the water source.