File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- $calc = dialog create " Admin Calculator" 0 0 148 229
1+ DPIAware
2+ VisualStyle
3+ $calc = dialog create " Admin Calculator" 0 0 148 229
24 $calc.FormBorderStyle = 6
35
46 $calc.maximumsize = new-object System.Drawing.Size((148 * $ (screeninfo scale)), (229 * $ (screeninfo scale)))
Original file line number Diff line number Diff line change 1+ DPIAware
2+ VisualStyle
13$Form = dialog create " TEST CURSOR" 0 0 321 196
24 $List1 = dialog add $Form ListBox 10 10 180 144 " ListBox1"
35 $reset = dialog add $Form Button 16 221 75 23 " reset"
Original file line number Diff line number Diff line change 1+ VisualStyle
2+
13if ((Get-Module - ListAvailable vds).count -gt 1 ){
24 $global :module = $ (path $ (Get-Module - ListAvailable vds)[0 ].path)
35}
Original file line number Diff line number Diff line change 1- info $null 2> $null
2- $vscreen = [System.Windows.Forms.SystemInformation ]::VirtualScreen.height
3- if ((get-host ).version.major -eq 5 ) {
4- [xml ]$xml = @"
5- <Window
6- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
7- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
8- </Window>
9- "@
10- $dum = (New-Object System.Xml.XmlNodeReader $xml )
11- $win = [Windows.Markup.XamlReader ]::Load($dum )
12- }
13-
14- $screen = [System.Windows.Forms.SystemInformation ]::VirtualScreen.height
15-
16- $global :ctscale = ($screen / $vscreen )
1+ DPIAware
2+ VisualStyle
173
184if ((Get-Module - ListAvailable vds).count -gt 1 ){
195 $global :module = $ (path $ (Get-Module - ListAvailable vds)[0 ].path)
Original file line number Diff line number Diff line change @@ -6,8 +6,20 @@ using System.Drawing;
66using System.Runtime.InteropServices;
77using System.Windows.Forms;
88using System.ComponentModel;
9+ using System.Collections.Generic;
910
1011public class vds {
12+
13+ public static void SetCompat()
14+ {
15+ // SetProcessDPIAware();
16+ Application.EnableVisualStyles();
17+ Application.SetCompatibleTextRenderingDefault(false);
18+ }
19+
20+ [System.Runtime.InteropServices.DllImport("user32.dll")]
21+ public static extern bool SetProcessDPIAware();
22+
1123[DllImport("user32.dll")]
1224public static extern bool InvertRect(IntPtr hDC, [In] ref RECT lprc);
1325
@@ -321,6 +333,17 @@ $global:fieldsep = "|"
321333$global :database = new-object System.Data.Odbc.OdbcConnection
322334set-alias run invoke-expression
323335
336+ function VisualStyle () {
337+ [vds ]::SetCompat()
338+ }
339+
340+ function DPIAware ($a ) {
341+ $vscreen = [System.Windows.Forms.SystemInformation ]::VirtualScreen.height
342+ [vds ]::SetProcessDPIAware()
343+ $screen = [System.Windows.Forms.SystemInformation ]::VirtualScreen.height
344+ $global :ctscale = ($screen / $vscreen )
345+ }
346+
324347function abs ($a ) {
325348<#
326349 . SYNOPSIS
You can’t perform that action at this time.
0 commit comments