Advertisement

Subclassing or Hooks

Started by January 07, 2001 03:33 PM
0 comments, last by pagghiu 24 years ago
Hi guys, i''m developing a simple DX8 wrapper and I wanted to support multiple windows.After I figured out how to do it (the dx8docs are not too explicative...) I created a class Win32Window (that contains a HWND) to support the 2 types of windows that my wrapper have to manage: 1)Windows created by the framework (I have my window procedure and I can process messages).I use the GWL_USERDATA to store the address of the Win32Window object associated with the HWND. 2)Windows not created by the framework (for example using a library like MFC or VCL). I need to have control over the window procedure of the latter (to trap the WM_SIZE,WM_ACTIVATEAPP,etc.) and I was wondering the right way to accomplish this task. Using window subclassing (GWL_WNDPROC)? Using hooks? I tryed the subclassing but I have some problems. I cannot figure what type of hook I should use. Is it safe to overwrite the GWL_USERDATA of a window that was not created by my framework?It could be used by the owner of the window... Suggestions? Thanks :-) ***************************** Pagghiu C++ 3D Programming spagghiu@yahoo.it (Italy) ICQ#: 28865466 *****************************
*****************************PagghiuC++ 3D Programmingspagghiu@yahoo.it (Italy)ICQ#: 28865466*****************************
Use subclassing...

What kind of problems do you have?
VK

This topic is closed to new replies.

Advertisement