What's an alternative to GWL_USERDATA for storing an object pointer?

后端 未结 2 644
清酒与你
清酒与你 2021-01-01 10:25

In the Windows applications I work on, we have a custom framework that sits directly above Win32 (don\'t ask). When we create a window, our normal practice is to put

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-01 10:59

    The other alternative is SetProp/RemoveProp (When you are subclassing a window that already uses GWLP_USERDATA)

    Another good alternative is ATL style thunking of the WNDPROC, for more info on that, see

    • http://www.ragestorm.net/blogs/?cat=20
    • http://www.hackcraft.net/cpp/windowsThunk/

提交回复
热议问题