QuoteThat's it. Feel free to call SetProcessDPIAwareness on 8.1 and later, and fall back to SetProcessDPIAware on earlier versions. Of course, I'd just remove the dpi aware section from the manifest.
Option Explicit
Private Enum PROCESS_DPI_AWARENESS
Process_DPI_Unaware = 0
Process_System_DPI_Aware = 1
Process_Per_Monitor_DPI_Aware = 2
End Enum
#If False Then
Dim Process_DPI_Unaware, Process_System_DPI_Aware, Process_Per_Monitor_DPI_Aware
#End If
Private Declare Function SetProcessDpiAwareness Lib "shcore.dll" (ByVal Value As PROCESS_DPI_AWARENESS) As Long
Private Sub Main()
Const S_OK = &H0&, E_INVALIDARG = &H80070057, E_ACCESSDENIED = &H80070005
Select Case SetProcessDpiAwareness(Process_System_DPI_Aware)
Case S_OK: MsgBox "The current process is set as dpi aware.", vbInformation
Case E_INVALIDARG: MsgBox "The value passed in is not valid.", vbCritical
Case E_ACCESSDENIED: MsgBox "The DPI awareness is already set, either by calling this API " & _
"previously or through the application (.exe) manifest.", vbCritical
End Select
End Sub
' inner function example
uses console
function myfun(long v) as long
==============================
'inner
function f(long k) as long
int c=10
return c+k*3 'problem with function=...
end function
function= f(v)+100
end function
print myfun(2) '116
wait
Page created in 0.194 seconds with 9 queries.