I’ve seen this a lot in posts on the forums and even in code submitted as part of bug reports
If TargetWindows Then
// Windows only code not excluded from compilation.
End If
The code inside the if will only execute on Windows. However becuase this code is just a normal if it HAS to COMPILE on ALL targets even if the intention is that it only be used on Windows (which it obviously is)
If you intend some code to ONLY be used on Windows you’re better off to use this form
#If TargetWindows Then
// Declares for example
#Endif
This code will ONLY exist in a Windows builds and so can ONLY execute on Windows.… Read the rest