tags:

views:

66

answers:

3

How to get the Window Class Name and Id from HWND?

I searched but found the opposite is more popular.

Any thoughts?!?!?

+1  A: 

GetClassName: http://msdn.microsoft.com/en-us/library/ms633582(v=VS.85).aspx

What do you mean with Id?

Arthur
God, you beat me with eight seconds!
Andreas Rejbrand
ThanksI heard there is an id that identifies specific window, if the application has more than one instance of the class.
Mohammad Abdelaziz
Mohammad, the *handle* identifies a specific window. You already have that.
Rob Kennedy
OK Thanks a lot
Mohammad Abdelaziz
A: 

GetClassName is exactly what you're looking for.

Andreas Rejbrand
A: 

Answers by Andreas and Arthur show how to get the class name. With 'Id' perhaps you mean the window identifier for child windows;

GetWindowLong(HWnd, GWL_ID)
Sertac Akyuz