Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can you change it

Status
Not open for further replies.

XerxesTheMighty

Programmer
Jun 15, 2003
72
US
Lets say I have an ID called ID_DEMO, but the funtion I'm trying to use has to have a hwnd. Is there way to connect the two?
for example:
when you call CreateWindow(); it has a hwnd for a ID (hwnd=CreateWindow(hWnd,......ID_DEMO)), is there another way to have a hwnd point to a ID?





Apocalyptic Programmer
 
I don't get exactly what you are saying...try posting exactly what you want to do. There is probably another way of doing it.
 
when you call CreateWindow(); you assign both a hwnd and an ID to that window (child or not). But when you create a dialog using a visual program, it only assigns an ID to that window. I'm using a function that requires the hwnd. so I need to assign the ID to the hwnd. If this is not possible, I'll just have to rewrite the program, without the visual dialog creation.





Apocalyptic Programmer
 
Ummm… the returned HWND value is for the newly created window that was created with the ID given as an input parameter. The other HWND given as an input parameter has nothing to do with the ID, rather it is used as the Parent window to the new/child window.

-pete
 
Not exactly sure what you mean, but if you mean how to get the HWND of a control on a dialog box, use the GetDlgItem API.

HWND hControl = GetDlgItem ( hDlg, IDC_xxx );

(hControl is what you want to know, hDlg is the handle of the dialog box and IDC_xxx is the ID of the control).


Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top