According to Mileage Plus. Thai will give you full mileage and class of service bonus but no status bonus. ANA will only give you 50% on super cheap economy, 70% on cheap economy and 100% on full fare economy. Business and First get you class of serice bonuses, No elite bonuses though.
Here is the link for the miles you earn on ANA.
http://www.united.com/page/article/0,,1182,00.html
Does not matter if it is code share or not, based on the metal you fly.