Hawkes processes have been widely used in many areas, but their probability properties can be quite difficult. In this paper an elementary approach is presented to obtain moments of Hawkes processes and/or the intensity of a number of marked Hawkes processes, in which the detailed outline is given step by step; it works not only for all Markovian Hawkes processes but also for some non-Markovian Hawkes processes. The approach is simpler and more convenient than usual methods such as the Dynkin formula and martingale methods. The method is applied to one-dimensional Hawkes processes and other related processes such as Cox processes, dynamic contagion processes, inhomogeneous Poisson processes, and non-Markovian cases. Several results are obtained which may be useful in studying Hawkes processes and other counting processes. Our proposed method is an extension of the Dynkin formula, which is simple and easy to use.