Let $C$ be an arbitrary point on $\omega$; let $AD$, $BE$, $CF$ be the altitudes of $\triangle ABC$ and let $H$ be their intersection.
We have $\angle AHF = \angle DHC = 90^\circ - \angle DCH = 90^\circ - \angle BCH$, the first by vertical angles and the second by complementary angles in a right triangle. Similarly, $\angle FHB = \angle CHE = 90^\circ - \angle HCE = 90^\circ - \angle HCA$. Putting these together, we get $$\angle AHB = \angle AHF + \angle FHB = 180^\circ - (\angle BCH + \angle HCA) = 180^\circ - \angle BCA.$$
Since $C$ lies on $\omega$, we know that $\angle BCA$ is constant (and is half the measure of the arc $AB$ that does not contain $C$). Therefore $\angle AHB$ is also constant, no matter how $C$ moves - which is exactly what we need to know that $H$ lies on a circular arc through $AB$.
(More precisely, that's what happens if $C$ stays on the same arc in $\omega$: in the picture, if $C$ stays above chord $AB$. If $C$ goes to the other arc, then $\angle BCA$ is replaced by its supplement $180^\circ - \angle BCA$,and so $\angle AHB$ is also replaced by its supplement. In that case, the orthocenter $H$ exactly traces out the other arc of the circle it was on before.)