|
-
May 25th, 1999, 01:07 PM
#1
Getting window class from HWND
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
-
May 25th, 1999, 01:25 PM
#2
Re: Getting window class from HWND
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|