If I have an HWND, is there a way to tell if this window is an edit control?
Also, is there a way to get a CWnd* from an HWND?
Thanks,
Jaime
Printable View
If I have an HWND, is there a way to tell if this window is an edit control?
Also, is there a way to get a CWnd* from an HWND?
Thanks,
Jaime
Attach it to a CWnd using the static CWnd function FromHandle.
CWnd* pWnd = CWnd::FromHandle(hWnd);
Then use runtime information.
if (pWnd->IsKindOf(RUNTIME_CLASS(CEdit)))
{
Do whatever...
}
You have a pointer to a CWnd* object now. It's not permanent though. For it to be permanent you should call the static function CWnd::FromHandlePermanent.