This is certainly a sticky subject:
Any time you share knowledge or idead with someone, be it your pal in the next cubicle, or the CEO of the company, there's risk of that person swiping the idea and making it their own. The approach I take is to share my ideas only with those people who would have little/no chance of a) Either duplicating my efforts or b) waging a legal battle for my thoughts.
Most companies I have worked for utilize a similar approach: If you build it, invent it, or concieve it while under the employment of said company, they own it.
Now -- There was an addendum to the employee agreement of one company, that allowed me to itemize any "inventions" concieved prior to my employment. These belonged to me. But that has been a rarity in my experiences.
"It is a very mixed blessing to be brought back from the dead." -- Kurt Vonnegut