Git Product home page Git Product logo

Comments (11)

MScholtes avatar MScholtes commented on July 17, 2024 1

Hello Christian,

I guess you mean the Powershell ISE.

OK, I understand. This could be done with a manifest. I see the problem that this manifest would have to be different for Windows 10, Windows Server 2016, Windows 8.1 and Windows 7.

Maybe you could try this code at the beginning of your powershell script before opening any window:

Add-Type -Name WinDPI -Namespace Native -MemberDefinition '
[DllImport("SHCore.dll", SetLastError = true)]
public static extern bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);

public enum PROCESS_DPI_AWARENESS
{
    Process_DPI_Unaware = 0,
    Process_System_DPI_Aware = 1,
    Process_Per_Monitor_DPI_Aware = 2
}
'

[Native.WinDPI]::SetProcessDPIAwareness([Native.WinDPI+PROCESS_DPI_AWARENESS]::Process_Per_Monitor_DPI_Aware) | Out-Null

If the parameter Process_Per_Monitor_DPI_Aware is not what you want you could try Process_System_DPI_Aware instead.
This should work beginning with Windows 8.1 but I do not know what happens in ISE.

Greetings

Markus

from ps2exe.

MScholtes avatar MScholtes commented on July 17, 2024

Hello chbwien,

you're obviously right. Please give me some time to investigate (it's Corona time and I'm at home working and supporting two little children). And don't expect much, since PS2EXE uses WinForms so the possibilities are limited.

Greetings

Markus

from ps2exe.

chbwien avatar chbwien commented on July 17, 2024

from ps2exe.

MScholtes avatar MScholtes commented on July 17, 2024

Hello Christian,

made some tests with scaling and found that the fonts doesn't look god with other scales but the controls scale fine. Using the advanced WinForm features introduced with Creators Update didn't change anything for me.

I enabled visual styles with the new version 1.0.4 so buttons look better. I do not what more I can do. Do you have a special situation or window where the view is problematic?

Greetings

Markus

from ps2exe.

chbwien avatar chbwien commented on July 17, 2024

from ps2exe.

MScholtes avatar MScholtes commented on July 17, 2024

Hello Christian,

sorry, I do not see any screenshot.

Are you talking about your own WinForms windows generated by your PowerShell script or about the windows PS2EXE generates?

Greetings

Markus

from ps2exe.

chbwien avatar chbwien commented on July 17, 2024

from ps2exe.

MScholtes avatar MScholtes commented on July 17, 2024

Hello Christian,

ok, I understand now. I thought that you were worried about the look of the PS2EXE generated windows.

I'm not sure if we can get what you want because the high DPI support of WinForms are limited.

  • How is the look if you execute your script "not compiled" as a PowerShell script?
  • Can you transfer your script to WPF windows? Only WPF delivers a good high DPI look.

Greetings

Markus

from ps2exe.

chbwien avatar chbwien commented on July 17, 2024

from ps2exe.

chbwien avatar chbwien commented on July 17, 2024

from ps2exe.

MScholtes avatar MScholtes commented on July 17, 2024

You're welcome

from ps2exe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.