SetWindowLongPtr not included, SetWindowLong available only

Started by 4C617273H, September 19, 2010, 05:41:27 PM

Previous topic - Next topic

Vortex

SetWindowLongPtr is a macro wrapper. If you check winuser.h :

#define SetWindowLongPtrA SetWindowLongA
#define SetWindowLongPtrW SetWindowLongW


You should use the SetWindowLong function.

4C617273H

Hi, ok, so SetWindowLong is already the new API?

I don't absolutely need it. I just read on msdn SetWindowLong is not thaat compatible with 64-bit Windows (even in 32-bit code).

MichaelW


WINUSERAPI
LONG
WINAPI
SetWindowLongA(
    IN HWND hWnd,
    IN int nIndex,
    IN LONG dwNewLong);

WINUSERAPI
LONG_PTR
WINAPI
SetWindowLongPtrA(
    HWND hWnd,
    int nIndex,
    LONG_PTR dwNewLong);


AFAIK the difference is in the compiler's handling of LONG_PTR.

http://msdn.microsoft.com/en-us/library/ms810720.aspx#midl64b_issues

Quote
INT_PTR, LONG_PTR
Each of these is a polymorphic integral type that has a different size on 32-bit and 64-bit Windows NT® platforms to guarantee that a pointer value can be stored in it. The data types are defined in the public file, basetsd.h. Each has a size of 4 bytes on 32-bit systems and 8 bytes on 64-bit systems. On 32-bit platforms, INT_PTR maps to int and LONG_PTR maps to long. On 64-bit platforms, both the types map to __int64.
eschew obfuscation