• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

[q]ID and Handle of a child window..

In BC++4.5, I used MDI in my application.
I want to convert a specific ID(integer) to handle type(hwnd) to use an API function such as InvalidateRegion.
In my application, many child windows are shown so I control one window in way of giving a specfic ID.
I think there exists a difference between integer type and hwnd type.. Right..?
 
How to do..?

Thanks..
0
lsjunii
Asked:
lsjunii
1 Solution
 
lsjuniiAuthor Commented:
Edited text of question
0
 
MikeP090797Commented:
Use the GetDlgItem() API to get the control hWnd by it's ID
0
 
lsjuniiAuthor Commented:
Is GetDlgItem() for child window API funtion..?
I used it in the Dialogbox...
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Tommy HuiEngineerCommented:
MikeP is correct. You can use GetDlgItem() for any windows regardless of whether it is a dialog or not.
0
 
lsjuniiAuthor Commented:
Dear Thui and MikeP:

GetDlgItem needs two parameters; handle of dialog box and ID.
So I don't know how to give the handle of dialog box(hDlg) because I used a child WINDOW.
Is this right.?

Anyway, I know there exists a API function(GetWindow()) when I search GetDlgItem at the help file..
I want to give above points to whom reply this message first..

Thanks for your assistance..


0
 
lsjuniiAuthor Commented:
Sorry, you right..
I know I should use only GetDlgItem function..
0
 
lsjuniiAuthor Commented:
Please reply my another question related to this problem..
Subject:"[q]let me show my code.."

Thanks..
0
 
lekshmikrCommented:
The GetDlgItem function retrieves the handle of a control in the specified dialog box.
HWND GetDlgItem(
    HWND hDlg,      // handle of dialog box
    int nIDDlgItem       // identifier of control
   );      
 

0
 
lsjuniiAuthor Commented:
Dear MikeP:

Write your proposed answer here because I want to give my above points
0
 
MikeP090797Commented:
k
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now