first of all, Annam is the not correct name for this period, but Dai Viet. Annam (peaceful South) was the former name when Vietnam was under Chinese rule. the name was changed later to Dai Viet (Great Viet). the war became unavoidable as Siam Kingdom sought hegemony in Laos and Cambodia.
In short, 3 wars were fought between Vietnam and Siam.
1785: Vietnamese victory
1831-34: Vietnamese victory
1841-45: undecided. Peace treaty, Cambodia was placed under joint Siamese-Vietnamese protection.
Vietnam became later the dominant power over Laos and Cambodia.