\documentclass{article}
\def\testbox#1{%
 \ifvoid#1 Box #1 is empty
 \else\ifhbox#1 Box #1 is horizontal
 \else\ifvbox#1 Box #1 is vertical
 \fi\fi\fi
 \par}
\begin{document}
\setbox100=\hbox{Goodbye}
\testbox{100}
\setbox101=\hbox{Hello}
\testbox{101}
\setbox102=\vbox{\box101,\box100}
\testbox{102}

Using...
\box102

\setbox103=\hbox{}
\testbox{103}

\testbox{104}

\[ a + \hbox{a}\]
\[ a + \vbox{a}\]

\[ a + \vbox{\hbox{a}\hbox{a}} \]
\[ a + \vtop{\hbox{a}\hbox{a}} \]

\[ a - \lower1ex\vtop{\hbox{a}} \]
\[ a - \lower1ex\vbox{\hbox{a}} \]

\[ a - \lower1ex\hbox{a} \]

\def\mybox#1{\hbox{#1}}
\[ a - \lower1ex\mybox{a} \]

\end{document}
