1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Sub version_ALLWin_Off()
Dim ppx#, version As String, X#, Y#, SuppLeft#, Suppop#
With CreateObject("WScript.Shell"): ppx = .RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ThemeManager\LastLoadedDPI") / 72: End With
version = CStr(Val(Split(Application.OperatingSystem, " ")(3)) & "-" & Val(Application.version))
'MsgBox version
SuppLeft = Switch(version = "6,01-12", 4, version = "0-15", 0, version = "10-16", -5, version = "10-15", -5, version = "10-14", 0)
supptop = Switch(version = "6,01-12", 4, version = "0-15", 0, version = "10-16", 0, version = "10-15", 0, version = "10-14", 0)
With ActiveWindow
X = .ActivePane.PointsToScreenPixelsX([D3].Left) / ppx
Y = .ActivePane.PointsToScreenPixelsY([D3].Top) / ppx
End With
With UserForm1
.Show 0
.Left = X + SuppLeft
.Top = Y + supptop
End With
End Sub |
Partager