如何在Delphi中禁用外部DLL窗体上的VCL样式 [英] How to disable vcl styles on external dll forms in delphi

查看:216
本文介绍了如何在Delphi中禁用外部DLL窗体上的VCL样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Delphi 10.1 Berlin中,我有一个使用VCL样式和外部DLL的问题.

I have an issue in Delphi 10.1 Berlin using VCL Styles and an external DLL.

我正在使用Nitgen DLL在我的应用程序中注册指纹.该过程由NBSPCOM.dll中的COM对象处理.

I'm using a Nitgen DLL to enroll fingerprints in my application. The process is handled by a COM object in NBSPCOM.dll.

当我调用要注册的方法时,DLL中的表格显得奇怪.它显示表单背景,图像和控件错误等.

When I call the method to enroll, the form from the DLL appears odd. It shows the Form background, images and controls are wrong, etc.

如果我在XE8中编译该应用程序,该问题将消失,并且一切正常.

If I compile the application in XE8, the problem vanishes and all works fine.

我找不到DLL表单的类来尝试VCL样式挂钩.

I can't find the class of the DLL forms to try a VCL Styles hook.

该表格的一些屏幕截图:

Some screenshots of the form:

原始表格

格式错误

推荐答案

使用VCL Styles时,本机winapi控件(静态,按钮,RebarWindow32等)的样式使用

When you uses the VCL Styles the native winapi controls (Static, Button, RebarWindow32, ...) are styled using a WH_CBT Hook, My guess is which the dll is using a static or Button winapi control where the background of the image is drawn. To overcome this you can disable the styling of these controls using the Vcl.Themes.TStyleManager.SystemHooks property like so

TStyleManager.SystemHooks := [];

这篇关于如何在Delphi中禁用外部DLL窗体上的VCL样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆