getting a window handle
I'm trying to retrieve a specific window handle and I'm not sure how to go
about it in regular win32 programming. First I have to get a parent window
of a dialog I create by using ::GetParent(hdlg) where hdlg is my dialog.
Next I need to get a child of that window with an ID of lst2, but I'm not
sure how to do that.
Maybe a cleaner way to describe it is as it was shown in MFC:
GetParent()->GetDlgItem(lst2);
My problem is that I'm not using MFC.
Can anyone help?
If you know the windows title you could use FindWindow like so:
HWND hwnd = FindWindow(NULL,"YourWindowTitle");
HWND hwnd = FindWindow(NULL,"YourWindowTitle");
I think you can translate that directly. You can always check out MFC sources, they're often no more than WIN32 wrappers.
Try this:
Try this:
GetDlgItem(GetParent(hdlg), lst2);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement