This item was deprecated in version 2018r1. Please use TargetWindows as a replacement.
Used to indicate that the code has been compiled for or is running on Microsoft Windows.
result = TargetWin32
Returns True if you are compiling Windows code.
TargetWin32 indicates that your application compiled or running on Windows (using the Win32 platform, as opposed to something like .NET). This is True for both 64-bit and 32-bit apps. If you need to detect whether an app is 32-bit or 64-bit, use the appropriate constants: Target32Bit and Target64Bit.
Use this code to follow a different code path when running on Windows:
If TargetWin32 Then // Do some Windows-specific stuff here End If
Using conditional compilation with the TargetWin32 constant means that this code will only appear in Windows builds:
#If TargetWin32 Then // Use Registry to save preferences #Endif
This example function can be used to detect if you application is building for a 64-bit version of Windows:
#If TargetWin32 #If Target64Bit // Building for 64-bit Windows #Else // Building for 32-bit Windows #Endif #EndIf
All project types on all supported operating systems.