- Window procedure parameters.
Window messages come in the form of (HWND,UINT,WPARAM,LPARAM).
Take the WM_CREATE message:
The LPARAM parameter points to a CREATESTRUCT structure. In order to access that structure, a cast is necessary.
Code:
CREATESTRUCT *cs = (LPCREATESTRUCT)lParam;
- Any Windows API function which uses a long to hold parameter values (there's a ton).
Code:
struct mystrdata *mydata = (struct mystrdata*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
or
Code:
struct mystrdata* mydata = (struct mystrdata*)SendMessage(hwndList, LB_GETITEMDATA,index,0);