This runs fine in 3.3.8.1 and did also as far as Beta 8 (and maybe later), but has not at least since beta 13 and through Beta 16.
;Global $hWnd = 0
Global $dpi = GetDPI_Ratio()
MsgBox(0,"",$dpi)
Func GetDPI_Ratio()
Local $hWnd = 0
Local $hDC = DllCall("user32.dll", "long", "GetDC", "long", $hWnd)
Local $aRet = DllCall("gdi32.dll", "long", "GetDeviceCaps", "long", $hDC[0], "long", 90)
Local $hDC = DllCall("user32.dll", "long", "ReleaseDC", "long", $hWnd, "long", $hDC)
If $aRet[0] = 0 Then $aRet[0] = 96
Return $aRet[0] / 96
EndFunc
You can comment out the local declare of $hWnd and toggle in the Global, and still get the "Variable used without being declared" error on $hWnd. Did I overlook something in the release notes?