- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
什么是TApplication.Handle
?
TApplication.Handle
Provides access to the window handle of the main form (window) of the application.
property Handle: HWND;
Description
Use Handle when calling Windows API functions that require a parent window handle. For example, a DLL that displays its own top-level pop-up windows needs a parent window to display its windows in the application. Using the Handle property makes such windows part of the application, so that they are minimized, restored, enabled and disabled with the application.
MainForm
的窗 Handlebars 的Application
Application.MainForm.Handle: 11473728
Application.Handle: 11079574
Application.Handle
?
Application
的 Windows® 窗口句柄的 MainForm
,那他们为什么不匹配呢? Application
的窗 Handlebars 的 MainForm
, 那这是什么? null
,
Peter Below in 2000 said :
This can cause some problems with modal forms shown from secondary forms.
If the user switches away from the app while a modal form is up, and then back to the form that showed it, the modal form may hide beneath the form. It is possible to deal with this by making sure the modal form is parented [sic; he meant owned] to the form that showed it (using
params.WndParent
as above)But this is not possible with the standard dialogs from the
Dialogs
unit and exceptions, which need more effort to get them to work right (basically handlingApplication.OnActivate
, looking for modal forms parented to Application viaGetLastActivePopup
and bringing them to the top of the Z-order viaSetWindowPos
).
WS_EX_APPWINDOW
,强制一个窗口出现在任务栏上(当使其成为非所有者的正常规则不足、不切实际或不可取时)。扩展样式:
procedure TForm2.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams( params );
Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
end;
If you click on a secondary forms taskbar button while another app is active this will still bring all the applications forms to front. If you do not want that there is option
Application.Handle
时,谁将所有表单带到前面.是
申请这样做?为什么要这样做?而不是这样做,不应该
不是 在做这个吗?
的缺点是什么不是 这样做;我看到了
的缺点做 它(系统菜单无法正常工作,任务栏按钮缩略图不准确,Windows® shell 无法最小化窗口。
Application
的帖子中,
Mike Edenfield says that the parent window sends other window's their minimize, maximize and restore messages :
This will add the taskbar button for your form, but there are a few other minor details to handle. Most obviously, your form still receives minimize/maximize that get sent to the parent form (the main form of the application). In order to avoid this, you can install a message handler for WM_SYSCOMMAND by adding a line such as:
procedure WMSysCommand(var Msg: TMessage); WM_SYSCOMMAND;
procedure TParentForm.WMSysCommand(var Msg: TMessage);
begin
if Msg.wParam = SC_MINIMIZE then
begin
// Send child windows message, don't
// send to windows with a taskbar button.
end;
end;Note that this handler goes in the PARENT form of the one you want to behave independantly of > the rest of the application, so as to avoid passing on the minimize message. You can add similar > code for SC_MAXIMIZE, SC_RESTORE, etc.
Application
“拥有”。 ?这是否意味着让所有者为空:
procedure TForm2.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.WndParent := 0; //NULL
end;
Application
它的窗口句柄干扰了我的表单,Windows 应该再次向我发送我的最小化/最大化/恢复消息吗?
Application
对象,它是主循环。
Application
对象解决? 最佳答案
应用程序窗口的原因有一点肮脏的历史。在开发 Delphi 1 时,我们知道我们想要为 IDE 使用“SDI”(分散在桌面各处的窗口)ui 模型。我们也知道 Windows 在那个模型上很糟糕(现在仍然如此)。但是我们也注意到,当时的 Visual Basic 使用了该模型,而且它似乎运行良好。经过进一步检查,我们发现 VB 使用了一个特殊的“隐藏” parking 窗作为“所有者”(Windows 有时会模糊父和所有者的概念,但区别类似于 VCL)用于所有其他可见窗口.
这就是我们解决包含主菜单的窗口很少聚焦的“问题”的方法,因此处理文件菜单的 Alt-F 根本不起作用。通过使用这个中央 parking 窗口作为中介,我们可以更轻松地跟踪消息并将其路由到适当的窗口。
这种安排还解决了另一个问题,即通常多个顶级窗口是完全独立的。通过让应用程序处理所有这些窗口的“所有者”,它们的行为都会一致。例如,您可能已经注意到,当您选择任何应用程序窗口时,所有应用程序窗口都会移到最前面,并保持彼此的 z 顺序。这也将使应用程序最小化并恢复为功能分组。
这是使用这个模型的结果。我们本可以手动完成所有这些工作以保持一切正常,但设计理念不是重新发明 Windows,而是尽可能地利用它。这也是为什么 TButton 或 TEdit 实际上分别是 Windows“用户”按钮和编辑窗口类和样式的原因。
随着 Windows 的发展,“SDI”模型开始失宠。事实上,Windows 本身开始变得“敌视”这种应用程序风格。从 Windows Vista 开始并继续到 7,用户 shell 似乎不适用于使用 parking 窗口的应用程序。因此,我们开始在 VCL 中进行调整,以消除 parking 窗口并将其功能移至主窗体中。这提出了几个“鸡与蛋”问题,即我们需要在应用程序初始化时足够早地让 parking 窗口可用,以便其他窗口可以“附加”到它,但主窗体本身可能不会很快构建。 TApplication 必须跳过几个环节才能使其正常工作,并且有一些微妙的边缘情况导致了问题,但大多数问题都已解决。但是,对于您前进的任何应用程序,它将继续使用旧的 parking 窗模型。
关于Delphi:什么是 Application.Handle?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2204804/
我想使用foreach 来等待线程终止。但是,出现以下错误,没有实现。请告诉我。 cannot move out of `*handle` which is behind a shared refer
如果在TypoScript中未配置给定的typeNum,则TYPO3将抛出Exception/CMS/1294587217。 背景:从另一个系统迁移到TYPO3后,我们遇到了许多此类异常,因为在那里使
我需要一个带有 2 个 handle 的 slider ,一个可拖动,另一个固定。我正在使用 Jquery UI slider 。这是我到目前为止尝试过的:http://jsfiddle.net/8K
给定文件的HANDLE(例如C:\\FolderA\\file.txt),我想要一个函数,该函数会将HANDLE返回到包含的目录(在前面的示例中,它将是C:\\FolderA的HANDLE)。例如:
我想通过Automic在Unix中检查文件。如果该文件不存在,则应切换主机并检查文件是否存在。 问题是,我现在不执行错误处理。 每当脚本对象正在处理并且找不到文件时,skript都会中止。我在skri
鉴于: fruitid('Apple', 'Granny Smith', 1). fruitid('Apple', 'Cox', 2). fruitid('Pear', 'Bartlett', 3).
我有一个基于Spring的Wicket应用程序。 有一个池化的数据源bean。 现在,当MySQL死了时,我得到了带有堆栈跟踪的默认Wicket错误页面。 我想处理这种情况,只允许某些页面完全显示(静
我希望能够一次查询多个句柄,其中表格具有相同的格式,例如: 句柄:8000,8001,8003表:foo 想要做这样的事情: x:hopen `8000`8001`8003 x select from
我对在Swift 3中引发自定义异常有些困惑。 在C++中,我可以执行此操作以立即停止方法中的进程,抛出错误并进行处理,而无需进一步进行操作。 void foo() { try {
我一直在阅读MSDN开发人员COM指南。但是this page上的代码令人困惑。在此处复制: The following code sample shows the recommended way o
我有一个计划的批处理文件每天都会启动的过程。如果有错误,我需要内置错误处理才能重启进程。所有这些在大多数情况下都有效,但是我每个月都会收到一次超时错误,所以这是不可避免的。该进程不会将错误级别输出到b
我正在尝试从 chartlyrics API 获取歌词。我编写了一个可以运行但不能在循环内运行的 R 函数。我的脚本是: library(httr) library(RCurl) library(XM
在libuv事件循环中调用prepare handle callback和check handle callback的原因是什么? 最佳答案 I/O 操作发生在这两者之间,因此您可能希望在阻塞 I/O
我正在尝试在 R 中安装 BTYplus 包。 devtools::install_github("mplatzer/BTYDplus", dependencies=TRUE) library(BTY
我有一个Arduino,可以使用pySerialTransfer库通过串行与Mac正常通信,并且可以运行数小时。然后是某种形式的串行中断-尽管一夜间发生时我一直无法确定原因,但只要从笔记本电脑上拔下A
我是hooks和async/await的新手。我正在尝试处理Axios调用中的错误,并且不确定如何使用then/catch或try/catch处理我的API调用中的错误。 在基于类的React中,我将
我正在尝试向脚本中添加一些内容,以便让我知道我复制的文件是否已被完全复制。 基本上,我要压缩一堆文件,然后将它们发送到网络上的映射驱动器。然后,一旦文件被成功复制,我将脚本删除原始位置的文件。该脚本可
我有一个圆形 slider ,其中绘制了一条贝塞尔弧,一个圆弧在 slider 的起点和终点有两个 handle ,圆弧是在圆形 slider 中绘制的。 借助开始和结束 handle ,我可以沿着圆
删除 NULL 指针是安全的。 int* p = NULL; delete p; // ok, secure 句柄是什么? HANDLE h = NULL; CloseHandle(h
如果您没有在 dojo.connect 期间返回的“句柄”,您如何删除 dojo 连接事件? 我的示例涉及将一组事件动态分配给一组对象。 (为简单起见,事件是 onclick 和 ondblclick
我是一名优秀的程序员,十分优秀!