Step 1: Assume the height of the tower and horizontal distance.}
Let the height of the tower be \(H\) and the horizontal distance of the observation point from the foot of the tower be \(x\).
The height of the flagstaff is already given as \(h\).
Therefore, the total height up to the top of the flagstaff is:
\[
H+h
\]
Step 2: Form the trigonometric equation for the bottom of the flagstaff.}
The bottom of the flagstaff is the top of the tower.
Since the angle of elevation of this point is \(\alpha\), we have:
\[
\tan\alpha=\frac{\text{height of tower}}{\text{horizontal distance}}
\]
\[
\tan\alpha=\frac{H}{x}
\]
So,
\[
H=x\tan\alpha
\]
Step 3: Form the trigonometric equation for the top of the flagstaff.}
The angle of elevation of the top of the flagstaff is \(\beta\).
Hence,
\[
\tan\beta=\frac{H+h}{x}
\]
Step 4: Substitute the value of \(H\) from Step 2.}
Substituting \(H=x\tan\alpha\) into the second equation, we get:
\[
\tan\beta=\frac{x\tan\alpha+h}{x}
\]
\[
\tan\beta=\tan\alpha+\frac{h}{x}
\]
Step 5: Find the value of \(x\).}
Rearranging the above equation:
\[
\tan\beta-\tan\alpha=\frac{h}{x}
\]
\[
x=\frac{h}{\tan\beta-\tan\alpha}
\]
Step 6: Find the height of the tower.}
We know that:
\[
H=x\tan\alpha
\]
Substituting the value of \(x\):
\[
H=\frac{h}{\tan\beta-\tan\alpha}\cdot \tan\alpha
\]
\[
H=\frac{h\tan\alpha}{\tan\beta-\tan\alpha}
\]
Step 7: State the required result.}
Hence, the height of the tower is:
\[
\boxed{\frac{h\tan\alpha}{\tan\beta-\tan\alpha}}
\]