Jump to content
Dave Craggs

Issue with CTRL-A

Recommended Posts

I am having a strange problem with CTRL-A and edit fields.

 

When the application is built from the IDE it CTL_A (select all) works. 

 

But it doesn't on my deployed application. This is built using FinalBuilder.

 

Any ideas folks?

 

Dave Craggs

Share this post


Link to post

Which Delphi version? I have a Ctrl-A patch unit in my Berlin but the only comment is that it's fixed in Tokyo 😄

 

edit: ok, it's something different from your issue.

 

Edited by Attila Kovacs

Share this post


Link to post

Looks like the Finalbuilder version uses a different manifest or an ancient style falling back to an old version of the common dialogs DLL. I have no idea how that could influence Ctrl-A behaviour in edit controls, though; that is handled by the native Windows control, unless you have an action or such that traps the key...

Share this post


Link to post

to extract from existing executable  use:

Mt.exe - Win32 apps | Microsoft Learn

 


"C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\microsoft.windows.sdk.buildtools\10.0.22621.755\bin\10.0.22621.0\x86\mt.exe" -inputresource:mydelphiprogram.exe -out:mydelphiprogram.manifest

 

Edited by mvanrijnen

Share this post


Link to post
24 minutes ago, Uwe Raabe said:

The FinalBuilder Action allows to specify a manifest, but it is not (yet) capable to build a new one from scratch. Seems you need to create one by yourself. Thankfully there is an article showing how to do it: https://www.finalbuilder.com/resources/blogs/windows-manifest-files

I did look at that, need to work out what values should be put into the manifest. Really don't know why I should need one 😞

Share this post


Link to post
29 minutes ago, Dave Craggs said:

Bit confused about manifest. Delphi suggests it shod auto generate, but I can't find any.

It's included in the .res file generated by Delphi so you can examine it with a resource editor.

image.thumb.png.50279b8a5be924c090f52c0b5f1614e1.png

 

Share this post


Link to post
Just now, Dave Craggs said:

Really don't know why I should need one

Because the manifest controls the runtime environment where Windows execute your application. If your application doesn't have a manifest (internal or external), then Windows assumes that your application is completely clueless about the environment and gives you one where you can party like it's 1999.

 

Apart from that, you seldom need to use a custom manifest; The one generated by Delphi should be good enough for most uses. Try examining the manifest setting in your project again.

Share this post


Link to post

Hmm - do I need to extract the XML from the res file so Finalbuilder can use it? 

 

Need to sort this out next week - am away for the rest of the week.

 

Thanks for the help so far.

 

Share this post


Link to post

The reason for the Ctrl A issues is because the manifest file controls what version of the common controls your application uses - without it you get the very old versions. 
 

8 hours ago, PeterBelow said:

Looks like the Finalbuilder version uses a different manifest or an ancient style falling back to an old version of the common dialogs DLL.


FinalBuilder uses the manifest file you specifiy in the Delphi Action. 

FBManifest.thumb.png.0ac793d38910a1ab2dc93df451cb27d2.png

 

3 hours ago, Dave Craggs said:

Hmm - do I need to extract the XML from the res file so Finalbuilder can use it? 

 

No, use the example in the blog post that @Uwe Raabe linked to - it's actually the manifest we use for FinalBuilder.  The blog post also details why you should not use the one generated by the IDE.

In fact FinalBuilder cannot use the delphi IDE generated manifest file for two reasons

  1.  The ide never saves the file anywhere but in the projectname.res file (annoyingly - since this is source code).
  2.  It uses a template file that uses variables only available to the delphi IDE. 

 

Share this post


Link to post
5 minutes ago, Dave Craggs said:

yes and Windows 11 probably.

There is no specific guid for Windows 11 accorrding to MS

"The following GUIDs correspond with the indicated operating systems:
{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a} -> Windows 10, Windows 11, Windows Server 2016, Windows Server 2019 and Windows Server 2022"

Share this post


Link to post
On 10/5/2023 at 7:37 AM, Vincent Parrett said:

You might also want to add high dpi support via the dpiAware or dpiAwareness elements 

It does say this in the blog. Am using Delphi 11.3

 

High DPI support.

I'm not going go into to detail on this, it's a complex issue with major differences between windows versions, and limited High DPI support in Delphi. I will say, think very carefully before you enable this, High DPI support in Delphi depends very much on the version of delphi, and third party control support. Don't just enable High DPI support without serious testing. See the msdn doco link at the bottom of this post.

Share this post


Link to post

This is what I am using now

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/>
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
        </requestedPrivileges>
    </security>
  </trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!--The ID below indicates application support for Windows Vista -->
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
      <!--The ID below indicates application support for Windows 7 -->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
      <!--The ID below indicates application support for Windows 8 -->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> 
      <!--The ID below indicates application support for Windows 8.1 -->
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> 
      <!--The ID below indicates application support for Windows 10 & 11 -->
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
    </application>
  </compatibility>
  <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
   <asmv3:windowsSettings
        xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
     <dpiAware>True/PM</dpiAware>
   </asmv3:windowsSettings>
</asmv3:application>
</assembly>

 

Share this post


Link to post

I set the version of the application when I build using FinalBuilder.

 

Would I need to edit the manifest during this process with the updated version? If so which is the best way to do this?

 

There is this

 

image.thumb.png.01cf214367348cb8522dea43e8e93db5.png

 

Share this post


Link to post

I generally just set the major version on the manifest , e.g 8.0.0.0 and don't bother with updating it for every build. I also wouldn't use the Mage tool if you are not using .net - it adds stuff to the manifest you don't need/want. 

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

×