Windows API calls.. moving to 64bit?

On the mac, trackpad/scrollwheel events registers properly.
On Windows, I could only get that to work by subclassing the window to trap mouse events.
Similarly, I used to have trouble filling listboxes and solved that years back with an API call to SendMessageA or Send MessageW with WM_SETREDRAW

So my code has a spattering of API calls that use USER32 and KERNEL32 under Windows.
(Stop redrawing of listbox while filling, making windows foremost, trapping unusual mouse events, getting windows version numbers among other things)

Do we have any guidelines about replacing these calls for a 64 bit build, or is it a case of rip them out and find another way?

[quote=227451:@Jeff Tullin]So my code has a spattering of API calls that use USER32 and KERNEL32 under Windows.
(Stop redrawing of listbox while filling, making windows foremost, trapping unusual mouse events, getting windows version numbers among other things)[/quote]

Windows 64 bit still remains a Win32 app, so the same calls are still valid. But since 64 bit integer is In64, you probably just need to replace all integers by Int32.

…brain explodes…
That feels like the support calls I get that say things like ’ I renamed the pdf file to end in .bmp but it still doesnt play music’
:wink:
Guess it still boils down to Try it and see…

Maybe the MSDN can help

MSDN Win32/Win64

Just as MichelB explained you will need to change some data types

Thanks Brian.

It says:

Which still makes me feel that a call to Kernel32 and User32 should fail.
Is there no Equivalent Kernel64 and User64?
Or is it enough to call these using ‘Long’ data types, and trust that the Long is promoted and understood as 64bit by both Xojo and the User32 / Kernel32 dlls?

Michel says

I dont understand this… surely a 64bit app is a 64bit app.
How can it be a Win32 app if its compiled for 64bit?
I know a 32bit app can run on a 64 bit OS using WOW…

[quote=227608:@Jeff Tullin]I dont understand this… surely a 64bit app is a 64bit app.
How can it be a Win32 app if its compiled for 64bit?
I know a 32bit app can run on a 64 bit OS using WOW…[/quote]

Do not confuse the framework name and the code addressing. Win32 does not stand for 32 bit code, it stands for the name of the underlying framework to a vast number of Windows apps, not all Xojo, which do not use the more recent framework : .Net.

Xojo Windows apps in both 32 and 64 bit are built on the Win32 framework.

@Jeff

It can be confusing I know

The WINAPI kernel32 has 64bit code but is still called kernel32

Just make sure you read the MSDN and call the right data types

MS really messed the names up
Win32 is the name of the API - but has no relation to its bitness (32 or 64)

@Norm

how would you like to dig through that API layer for MS? :stuck_out_tongue:

Ummmm … no :stuck_out_tongue:

https://en.wikipedia.org/wiki/Windows_API

Although I am not too sure of their reference to a ‘Win64’. Searching for it on Msdn leads no result at all.

MS is renaming the API so it doesn’t have this connotation of “32 bit”
https://msdn.microsoft.com/en-ca/library/windows/desktop/ff818516(v=vs.85).aspx
See where they say

Note that this was formerly called the Win32 API. The name Windows API more accurately reflects its roots in 16-bit Windows and its support on 64-bit Windows.

All helpful, thank you.
I can only tick one as the answer, but all helpful.