1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub all_themesW_7_bis()
Dim PpXO As Double, Theme_aero As Boolean, BdW#, LFT, TP
With CreateObject("WScript.Shell")
PpXO = .regread("HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\AppliedDPI") / 72
Theme_actif = .regread("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ThemeManager\ThemeActive")
themes = .regread("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\CurrentTheme")
Theme_aero = Theme_actif = 1 And Not themes Like "*basic*"
End With
With ActiveWindow
BdW = IIf(Theme_aero, UserForm1.Width - UserForm1.InsideWidth, 0)
LFT = (ActiveWindow.ActivePane.PointsToScreenPixelsX(ActiveCell.Left) / PpXO) + BdW
TP = (ActiveWindow.ActivePane.PointsToScreenPixelsY(ActiveCell.Top) / PpXO) + BdW
End With
With UserForm1
.StartUpPosition = 0
.Show 0
.Left = LFT '(ActiveWindow.ActivePane.PointsToScreenPixelsX(ActiveCell.Left) / PpXO) + BdW
.Top = TP '(ActiveWindow.ActivePane.PointsToScreenPixelsY(ActiveCell.Top) / PpXO) + BdW
End With
End Sub |
Partager