?
Solved

Getting HWnd instance of Parent

Posted on 2005-04-04
4
Medium Priority
?
1,008 Views
Last Modified: 2013-11-20
Hi All,

I have HWND instance of a Dialog. Now I wanted to get the HWND instance of the parent. How can I get it??

Thanks
Sudhakar
0
Comment
Question by:sudhakar_koundinya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 13696589
HWND hParent = ::GetParent(hwnd);
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 13696601
Ok thanks

Just one more question

can I get Dlg Id like this??
GetDlgCtrlID(hDlg)
0
 
LVL 48

Assisted Solution

by:AlexFM
AlexFM earned 500 total points
ID: 13696689
Using GetDlgCtrlID you can get dialog control ID and not dialog ID. Why do you need dialog ID? It is not used in any function.
Every MFC CDialog-derived class has dialog resource ID which looks this this:
enum { IDD = IDD_DIALOG1 };    // see this line in dialog h-file

You van use IDD to get dialog resource ID (though I don't know where it may be used).
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 13696892
Ok I am accessing the dialogs of Microsoft Outlook using my application.

Using FindWindow I can access the dialogs. But the problem is Main Window will be in hidden mode. So to Work with Window Messages on that Dialog, I am thinking that I need to have Parent Window Instance also. That is the reason I am asking this question

Thanks
Sudhakar
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question