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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using subclassed controls

Status
Not open for further replies.

woogoo

Programmer
Feb 14, 2004
247
GB
Hi all,

I've already asked this in the Visual C++ Forum but now that I've found this one, it may be the better place to ask.

Is is possible to use a subclassed control in a dialog box that's been created from Resource using the DialogBox() function?

If I'm wrong in my thinking then how can it be done?

Thank you.


 
You can subclase anything what have a HWND and you can obtain the WNDPROC of that (inside your own process). To get the hWnd of an item use GetDlgItem but to get the WNDPROC use GetWindowLong with GWL_WNDPROC

Ion Filipski
1c.bmp
 
Hi,

Thanks for the reply. But this really doesn't appear to answer my question. As I understand it, if I want to use a subclassed control within a dialog box I need to first derive a class from the resource. I then add member variables to this calss. It's at this point that I can then change the control's type to that of the subclassed version.

However, since no class exists for this dialog how can it be done. Is what you say above the way to do it? If so would you be good enough to provide me with an example?

Thanks again.
 
The above is just the responce to your question. You should create a new and replace the old one. No additional classes are required there to create. If you want an example search in google.com.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top