Solved

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

Posted on 1998-05-08
10
191 Views
Last Modified: 2013-12-04
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
Comment
Question by:lsjunii
10 Comments
 

Author Comment

by:lsjunii
ID: 1399907
Edited text of question
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1399908
Use the GetDlgItem() API to get the control hWnd by it's ID
0
 

Author Comment

by:lsjunii
ID: 1399909
Is GetDlgItem() for child window API funtion..?
I used it in the Dialogbox...
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1399910
MikeP is correct. You can use GetDlgItem() for any windows regardless of whether it is a dialog or not.
0
 

Author Comment

by:lsjunii
ID: 1399911
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
 

Author Comment

by:lsjunii
ID: 1399912
Sorry, you right..
I know I should use only GetDlgItem function..
0
 

Author Comment

by:lsjunii
ID: 1399913
Please reply my another question related to this problem..
Subject:"[q]let me show my code.."

Thanks..
0
 
LVL 1

Expert Comment

by:lekshmikr
ID: 1399914
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
 

Author Comment

by:lsjunii
ID: 1399915
Dear MikeP:

Write your proposed answer here because I want to give my above points
0
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 50 total points
ID: 1399916
k
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

696 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