I have a question about win32 API programming.

Lets say I have a window handle ( WHND ) and I wish to know whether it is a button or an Edit Box or a window and etc, how can I know this ?