What are the alternatives of using GWL_USERDATA to get an object pointer?
LONG_PTR SetWindowLongPtr( HWND hWnd, int nIndex, LONG_PTR dwNewLong );
SetWindowLongPtr(hWnd, GWLP_USERDATA, this);
LONG_PTR GetWindowLongPtr( HWND hWnd, int nIndex );
LONG_PTR lpUserData = GetWindowLongPtr(hWnd, GWLP_USERDATA); MyObject* pMyObject = (MyObject*)lpUserData;
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 4.0
- Is gettimeofday() guaranteed to be of microsecond resolution?
- Embedding Windows Media Player for all browsers. Will help in making it portable.
- Register Windows program with mailto protocol programmatically.
- How do I see preview JPEG file of PDF on Windows?
- What are the best ways to access Exchange using PHP?
- Visual Studio Setup Project - Per User Registry Settings.
- What is the best file copy alternative than the Windows defaults?
- What does wiggling the mouse do?
- How can I retrieve a windows filename?
- How do I install Debian in Windows?
- Windows Equivalent of 'nice'.
- How do you create your own moniker (URL Protocol) on Windows systems?
- Registry vs. INI file for storing user configurable application settings. In Linux, registry vs. INI file for storing user configurable applications settings.
- How can I redirect stderr from calls to fprintf?
- How do I wrap RSYNC for Windows?