News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Get/Set Class/Window LongPtr Functions Missing

Started by dedndave, October 08, 2012, 04:22:09 AM

Previous topic - Next topic

dedndave

GetClassLongPtr
GetWindowLongPtr
SetClassLongPtr
SetWindowLongPtr

missing from user32.inc

i know - they are probably "aliases" for Get/Set Class/Window Long functions on 32-bit OS's
but - it would be nice to have them   :P

dedndave

ok - my mistake
they do not show up in my version of user32.dll (xp sp3)

i was going by the MSDN documentation...
QuoteNote: To write code that is compatible with both 32-bit and 64-bit versions of Windows,
use GetClassLongPtr. When compiling for 32-bit Windows, GetClassLongPtr is defined
as a call to the GetClassLong function.

i suppose you could make that happen with some TEXTEQU's

TouEnMasm

Quote
IFDEF _WIN64
;API
GetClassLongPtrA PROTO :DWORD ,:DWORD
;API
GetClassLongPtrW PROTO :DWORD ,:DWORD
IFDEF UNICODE
GetClassLongPtr   equ   < GetClassLongPtrW>
ELSE
GetClassLongPtr   equ   < GetClassLongPtrA>
ENDIF ; !UNICODE
and .....

Quote
IFDEF UNICODE
SetClassLongPtr   equ   < SetClassLongPtrW>
ELSE
SetClassLongPtr   equ   < SetClassLongPtrA>
ENDIF ; !UNICODE
ELSE
GetClassLongPtrA   equ   < GetClassLongA>
GetClassLongPtrW   equ   < GetClassLongW>
IFDEF UNICODE
GetClassLongPtr   equ   < GetClassLongPtrW>
ELSE
GetClassLongPtr   equ   < GetClassLongPtrA>
ENDIF ; !UNICODE

Just replace the call to GetClassLongPtr by GetClassLong
And if the future of your code is to be build under 64 bits ,you are ready.
Use the "ready to use sdk" for this,citations are extract for him.






Fa is a musical note to play with CL

MichaelW

In the Microsoft WinUser.h, unless _WIN64 is defined the ...LongPtr function names are effectively equated to the older functions:

#define GetClassLongPtrA    GetClassLongA
#define GetClassLongPtrW    GetClassLongW

Well Microsoft, here's another nice mess you've gotten us into.