Jump to content
jsen262

Delphi 7 compatibility with Windows 11?

Recommended Posts

Hi, I've an old application developed in delphi 7 , having some issue about showin forms

 

when I ran on win 10 there's nothing wrong, seems normal. but when I ran on win 11 the form become oversize.

Can somebody help me, how to ajust this in win 11 without change the project's source code.

 

Both of them... I ran it in 1920 * 1080 resolution

 

Thanks in advanced....
 

 

 

run_at_win10.jpeg

run_at_win11.jpeg

Edited by jsen262
the picture

Share this post


Link to post
2 hours ago, jsen262 said:

Hi, I've an old application developed in delphi 7 , having some issue about showin forms

 

when I ran on win 10 there's nothing wrong, seems normal. but when I ran on win 11 the form become oversize.

Can somebody help me, how to ajust this in win 11 without change the project's source code.

 

Both of them... I ran it in 1920 * 1080 resolution

 

Thanks in advanced....
 

 

 

run_at_win10.jpeg

run_at_win11.jpeg

Hard to know why this is happening with the information we have. 

Share this post


Link to post
2 hours ago, jsen262 said:

old application developed in delphi 7

did you try right-click on executable and change the options ...(compatibility, etc...) and Snap Layout setup in Win11?

note: changing scale can help in some situation... but this is used for all apps including Win11-apps

 

note2: did you try FancyZones is a tool part of the PowerToys app that allows you to manage windows on Windows 11 and 10

https://youtu.be/ld-vmpbngDE

Edited by programmerdelphi2k

Share this post


Link to post

thanks @programmerdelphi2k for your insight,

both of them has been set 100% on scale in windows display setting.

 

I'll try the powertoys, hopefully can solve this issue.

 

Thanks.... I'll share the result

Share this post


Link to post
2 hours ago, jsen262 said:

thanks @programmerdelphi2k for your insight,

both of them has been set 100% on scale in windows display setting.

 

I'll try the powertoys, hopefully can solve this issue.

 

Thanks.... I'll share the result

Sorry @programmerdelphi2k

I've installed powertoys, but I can't find any setting to solve my problem

 

If I have to change the source, what part/component should I change ?

is tPanel component not suite for win 11 ?
 

Thanks

Share this post


Link to post
4 hours ago, jsen262 said:

both of them has been set 100% on scale in windows display setting.

That would be my first suggestion too... different dpi settings.

Weird that's not the case here. Looking at the screenshots there is really something going on with different font/dpi settings.

 

Do you include a manifest.txt in your program/resources?

Is this a designed form (not created at runtime)? And is it designed on 100% 96dpi (pixelsperinch)?

Is your developing machine Windows 10? With Delphi 7?

 

Scaled etc. shouldn't matter if both are on 100% 96 dpi. In that case Delphi 7 also shouldn't matter because it doesn't do anything if it's just at 100%.

 

Try to make a small test program with just some tlabels and tpanels and see if you that also goes wrong.

 

Share this post


Link to post

Instead of us guessing, it would be more productive for you to boil this down to the simplest example that reproduces the issue. 

Share this post


Link to post

@rvk yes, the font become smaller (pls see red box in attached pict )

 

 

 

>> Do you include a manifest.txt in your program/resources?
No, I dont use a manifest
 

>> Is this a designed form (not created at runtime)? And is it designed on 100% 96dpi (pixelsperinch)?

this is run time pict,
 

>> Is your developing machine Windows 10? With Delphi 7?

yes , delphi 7 on win 10
as I said before, if I ran the .exe on win xp to win 10 22H2 is normal, not either font size changing or form shrinking.

Please if any other suggestion, I'll try....

Thanks

font smaller.png

Share this post


Link to post

You can also check the default system font size in Windows (do not choose Large letters etc.).

 

But you can begin by setting a default static font and size at startup in Delphi. Otherwise a system font is taken at startup which can be different on every system. And some components get resized according to the fontsize).

 

Application.DefaultFont

See https://www.delphipower.xyz/handbook_2009/default_fonts_for_application_and_screen_global_objects.html

 

But it's much easier to do this in a small test program than doing this in your final program.

 

Share this post


Link to post
5 hours ago, rvk said:

Application.DefaultFont

Nice property, I wasn't aware of it. But it's D2009+

Share this post


Link to post
31 minutes ago, Fr0sT.Brutal said:

Nice property, I wasn't aware of it. But it's D2009+

Yes.

 

What font does Delphi 7 use. Always the font in which it is designed (font property of the form)?

 

In that case... what font did you set in the form property? If that font isn't available anymore in Windows 11, this could also explain a lot.

 

So specify a font which still exists on W11 or install the font used in D7.

 

Share this post


Link to post

Windows 11 did change the default font to Segoe UI variable which is supposed to scale better on High-DPI displays than Segoe UI (Vista onward). It changes how some characters look including how tall they are which could lead to some UI issues. 

Share this post


Link to post
14 hours ago, rvk said:

In that case... what font did you set in the form property? If that font isn't available anymore in Windows 11, this could also explain a lot.

Fair point! Probably D7 default MS Sans (IIRC) was removed from W11

Edited by Fr0sT.Brutal

Share this post


Link to post
36 minutes ago, Fr0sT.Brutal said:

Probably D7 default MS Sans (IIRC) was removed from W11

Nope, still there, why would MS remove it

Share this post


Link to post

It might not be the default font MS Sans which is used.

Or there is some font substitution going on.

 

If you look at the image, you definitely see the fonts are different.

 

w11-w12.png

 

Edited by rvk

Share this post


Link to post

sorry @rvk, I was bussy lately...

I always use default font as you can see below

 

image.thumb.png.98ab189ed6e042216811d0379e9ebbe5.png

 

using MS Sans Serif

for applications running on Windows 11... also use the same source

Share this post


Link to post

Maybe its the default font but it definitely displayed differently (look at the capitol G which is different).

 

So maybe there is still some font substitution going on.

 

You can first look in this registry entry to see if that font is substituted.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes

 

Btw. You showed the font for a tlabel. But if the parentfont prop is true, it will take the font from the form. And it could be that for that the screen.font is used which might use the default menu font from windows.

 

If that's the case you might want to do a Application.DefaultFont.Name := 'MS Sans Serif'; (or other font) before creating any forms in your .dpr).

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×