Original Post
For the first time, I've come into the situation where I need to send some data to a window as it is created, it seems to be that putting a pointer in lpParam in CreateWindowEx is the sensible way, and that I can get this number from the lpCreateParams member of CREATESTRUCT, right? It's just that the Windows NT remarks confuse me a bit, when I read the description Is x==myData? The size of the structure seems odd, and what the hell does the unaligned thing do? Does this happen under any other versions of Windows? Thanks
Quote:It seems to me that this means if x==lpParam under Win9x then x==*(lpParam+2) under windows NT, but the code example in the docs seems a little odd
This member is the address of a SHORT (16_bit) value that specifies the size, in bytes, of the window creation data. The value is immediately followed by the creation data.
typedef struct tagMyData {
. . .; // define creation data here
} MYDATA;
typedef struct tagMyDlgData {
SHORT cbExtra;
MYDATA myData;
} MYDLGDATA, UNALIGNED *PMYDLGDATA;
PMYDLGDATA pMyDlgdata =
(PMYDLGDATA) (((LPCREATESTRUCT) lParam)->lpcreateParams);